Errorhandling for a phone number field

H

help!

Does anyone have code to stop the Access error pop-up when entering in a
phone number wrong. I would like to have my own error message pop-up.

thanks!
 
G

Graeme Richardson

Hi, trap the Form Error event, display your message and tell MS Access not
to display it's message:

Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 2279 Then
MsgBox "Text is not formatted correctly. Please re-enter"
Cancel = acDataErrContinue
End If
End Sub

You might also be able to parse the entered data and point out the specific
error.

HTH, Graeme.
 

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