to prevent writing in the text box of combobox?

N

Nad

Hi Guys!
How can I prevent user to write in the text box of the combobox.
They can select only from the drop-down list.
Row Source type = Value List
Row source = abc;def;ghi...

Regrads,
 
A

Allen Browne

If you set the combo's Locked property to Yes or Enabled to No, the user
will not be able to use the combo. If you don't lock/disable the combo, they
can type into it.

Perhaps you could set its Limit To List property to Yes, so they can't type
anything else except a valid value.
 
K

ken

If you want to prevent a user typing anything into the combo box while
still being able to select an item from the list with the mouse you
can put the following in its KeyPress event procedure:

KeyAscii = 0

This will mean that the auto expand facility won't be available,
however, so even if the user types the first character(s) of an item
which is in the list it won't automatically go to that item. The only
way they'll be able to select an item is via the mouse, though they
could drop down the list with the mouse and then use the vertical
arrow keys and Enter key to select an item.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top