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

Can I override a system error message? 1

Status
Not open for further replies.

regava

Programmer
May 24, 2001
152
US
I have a form with several txt boxes bound to a table. The General information for a specific entry is as follows:
Data Type = Text
Field Size = 20
Caption = Reps' Last Name
Default Value =
Validation Rule = Like "" or is Null
Validation Text = NOT VALID
Required = Yes
Allow Zero Length = No
Indexed = Yes(Duplicate OK)
Unicode Compression = Yes
The form is displayed with all the information that was entered before. If the user deletes the information for the above entry (by mistake or on purpose) Access issued the following message: "The field 'tblReps.RepLname' cannot contain a Null value because the Required property for this field is set to True. Enter a value in this field."
My question is: Is there a way to override the above message by issuing my own message? Either by disabling the system message and allow me to do the error checking, or finding the correct way to handle the Validation Rule/Validation Text, or any other way.
Any suggestion is appreciated.
 
Have a look at the Error event of the Form object.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV thanks for your help.
The complete answer can be found under 'Error Event - Event Procedures Example' in the Access Help.
By the way, is there a way to find out all the error codes and definitions in Access?
Have a wonderful day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top