how do u restrict someone from writing in a combo box ?

beanbeanbean

Registered User.
Local time
Yesterday, 17:33
Joined
Sep 17, 2008
Messages
124
hi, i have a few combo boxes on my form.

the problem is that even thought i have a data in the combo box, people still can type data into the combo box as thought as it is a textbox.

may i know how to restrict that ? thanks.
 
Look in the properties of the combo box, specifically the Data tab.
 
one way is to put this on the keydown event:
Code:
    If KeyCode <> vbKeyTab Then
        KeyCode = 0
    End If
 
hey wazz ! thanks buddy. thats a great help. i'm from sg =D neighbour.
 
hey neighbour. glad it worked.
 
Wouldn't 'Limit to List' setting on said Combo Box achieve this?
 
Indeed it does but it spanks the User as well with that annoying message unless you of course add Response = acDataErrContinue into the Not In List event.. If however, you want to be more subtle and keep he User in bewilderment then destroying the keystroke as Wazz has suggested is the way to go.

.
 
I'd prefer to spank the user and let them know that they are doing something wrong (and shouldn't do it again), rather than leave them in complete utter confusion, and possible calling IT Support that their keyboard doesn't work :D
 
not a bad point.
i usually use the notinlist with acdataerrcontinue and a short msg.
if using the keydown a short spank-you msg might be a good idea.
 
How true that is Singh400....how true that is.

It falls hand in hand with Users using the Eject tray of their CD or DVD player in their desktop computer as a coffee cup holder. :)

.
 

Users who are viewing this thread

Back
Top Bottom