Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When NotInList how do I leave combobox?

Status
Not open for further replies.

Eightball3

Programmer
Nov 23, 2002
138
US
This is probably an easy question to answer but I'm having a bit of a problem with it. I have a combobox that has the LimitToList property set to true. When a user types something in the combobox that is not on the list, they can't leave the field until they select something off the list. There is a cancel button on the form that I would like them to be able to use when they realize that what they've typed is not in the list. As it is now the only option to get them out of the combobox is to hit the ESC key then push the cancel button. Thanks for any help.
 
Private Sub Comboname_NotInList(NewData As String, Response As Integer)
MsgBox "this item is not in list"
Response = acDataErrContinue
SendKeys "{esc}"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top