combo box

  • Thread starter Thread starter a
  • Start date Start date
A

a

thank you
I want prevent user form typing any data in combo box just select ( what
code I need)
 
Private Sub Combo0_KeyPress(KeyAscii As Integer)

Select Case KeyAscii
Case vbKeyEscape, vbKeyTab, vbKeyBack, vbKeyReturn
'OK, do nothing.
Case Else
KeyAscii = 0
End Select

End Sub

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
a said:
I want prevent user form typing any data in combo box just select ( what
code I need)


Typing the initial characters of an item in the list is a
standard way to select an existing item.

What you want to do is set the combo box's LimitToList
property to Yes to prevent users from trying to enter new
values.
 
Back
Top