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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not in the list

Status
Not open for further replies.

pooterpooter

Technical User
Oct 7, 2005
11
BG
I have a combo box called CustomerID with which i use to select the customer i want.If i select a cutsomer that does not exist, then
the folloiwng message appears:
" The text you entered isnt an item in the list.Select an item from the list or enter text that matches one of the listed items"

This creates me enormous problems, since the combo box stays with the name or number i have seletced and that is not in the list.
When i click on some other control for example to exit the database, then the database get stuck.
can you help me imrpove my combo box ? I want , when the user chooser a wrong or non existen customer, to clear the combo box
in such a way that i have no further problems with freezing the database.How can i achieve that?
 
How are ya pooterpooter . . .

Try this in the [blue]NotInList[/blue] event:
Code:
[blue]   Dim Msg As String, Style As Integer, Title As String
   Dim DL As String
   
   DL = vbNewLine & vbNewLine
   
   Msg = "Invalid Data Entry!" & DL & _
         "Data entry must be in the list!" & DL & _
         "Enter another value and try again . . ."
   Style = vbInformation + vbOKOnly
   Title = "Not In List Error!"
   MsgBox Msg, Style, Title
   
   Response = acDataErrContinue
   Me!ComboboxName.Undo[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top