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!

Validate field format in code

Status
Not open for further replies.

hpl2001

Programmer
Dec 18, 2001
105
CA
Hello:

I have an access database, with a form field that has the following input mask: !0000\-00000;0;_

When a user eneters a value that does not match I get an error message the requests the above described input format (confusing to user). I would like to capture any error so that I can display a message to show that the format should be 0000-00000. I want to use VBA to test if the current value for the field follows this input mask, but I'm not clear on how to code that. Any thoughts?


 
Use the Error event procedure of the Form.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Here's one nice reference (I'm sure you can find many others) with lots of detail on using the Error Handler in Access databases:

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top