Record not found from ComboBox

dcjones

Dereck
Local time
Today, 04:16
Joined
Mar 10, 2004
Messages
108
Hi All.

I have a form with a Combo Box that the user can use to select a record. What I would like is, if the user types in a search that is not in the Combo Box list, I want a message box to popup that informs the user that the record does not exist.

Can anyone point me in the right direction.

Kind Regards, keep safe and well.


Dereck
 
You could put something like this on the Not In List event of the combo box:

Private Sub cboSearchEarTag_NotInList(NewData As String, Response As Integer)
On Error GoTo ErrorHandler

MsgBox "You have entered a record that doesn't exist." & vbCr & _
vbCr & "Please try again!", , "No Data"

Response = acDataErrContinue

Exit Sub

errorhandlerexit:
Exit Sub

ErrorHandler:
MsgBox Err.Description
Resume errorhandlerexit

End Sub
 
Hi DBL,

Thanks for that.

Works a treat.

All good things come from Scotland, including my wife.

Thanks,

Dereck
 

Users who are viewing this thread

Back
Top Bottom