UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Code Multiple Combobox, Access 2016    
 
   
mylton
post Sep 16 2019, 09:17 AM
Post#1



Posts: 50
Joined: 13-June 16



Good Morning.
There is a combo box coding that prevents the user from accidentally typing anything into it.
would be using:
Private Sub CboTESTE1_KeyPress (KeyAscii As Integer)
KeyAscii = 0
End Sub
I have a form with several combo. instead of programming one by one I would like to create a function that encompasses all these combos.
to try to make it easier to name them CBOTESTE1 until COMBOTESTE 20.
Unfortunately I am not knowledgeable enough to set up a function.
Could someone help me?
thanks.
Go to the top of the page
 
theDBguy
post Sep 16 2019, 10:43 AM
Post#2


Access Wiki and Forums Moderator
Posts: 76,424
Joined: 19-June 07
From: SunnySandyEggo


Hi. If the user is not supposed to type into the box, why is it enabled? Just curious...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
mylton
post Sep 16 2019, 11:23 AM
Post#3



Posts: 50
Joined: 13-June 16



Looking at this, perhaps it is better not to allow it directly in the properties.
what do you think?
Go to the top of the page
 
theDBguy
post Sep 16 2019, 11:28 AM
Post#4


Access Wiki and Forums Moderator
Posts: 76,424
Joined: 19-June 07
From: SunnySandyEggo


Sounds good to me.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
strive4peace
post Sep 17 2019, 07:29 AM
Post#5


strive4peace
Posts: 20,459
Joined: 10-January 04



adding on, if you want the user to be able to select and copy what is in the control, instead of Enabled=False, you might want to set Locked=True

--------------------
have an awesome day,
crystal
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    22nd October 2019 - 07:21 PM