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!

Capturing error when using and edit mask

Status
Not open for further replies.

hpl2001

Programmer
Dec 18, 2001
105
CA
Hi:

I have an access program that uses edit masks for some data field in my input forms. I want to capture the event when a user tries to make an entry that does not match the mask - i.e. I want to customize the error message that access is generating. Can anyone tell me how to capture this particular error?

TIA.

Holly
 
I don't think you can.

However you could use the afterupdate event to replicate the behavior of an input mask (look at the oldvalue property for when you want to set it back) and do any custom logging in the afterupdate event.
 
Duane's correct here, as usual.

Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)

Select Case DataErr
 Case 2279
  MsgBox "your error message goes here"
  Response = acDataErrContinue
 Case Else
  MsgBox Err.Number & "   " & Err.Description
End Select

Response = acDataErrContinue

End Sub

Just replace my message with your own.


The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top