Combo box error message

G

Guest

I have a combo box that is set to list only. When a user tries to input
something else Access gives a message box saying the value is not in the list.

How can I change this message to my own?

I tried on error in the forms property. It did bring up my message box, but
it also brought up the Access message as well.
 
K

Keith Wilby

Keith said:
I have a combo box that is set to list only. When a user tries to input
something else Access gives a message box saying the value is not in the
list.

How can I change this message to my own?

I tried on error in the forms property. It did bring up my message box,
but
it also brought up the Access message as well.

You need to determine the error number and trap it, something like

If Err.Number = nnnn Then
'Your custom message box
Else
MsgBox Err.Description
End If

HTH - Keith.
www.keithwilby.com
 
G

Guest

Private Sub Combo1_NotInList(NewData As String, Response As Integer)
MsgBox "Invalid value, you knucklehead!"
Response = acDataErrContinue
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top