to prevent writing in the text box of combobox?

  • Thread starter Thread starter Nad
  • Start date Start date
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,
 
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.
 
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
 
Back
Top