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!

Changing default error messages

Status
Not open for further replies.

bizna

Technical User
Jul 23, 2007
3
CA
Hi all,

When a user is entering data in a form, and they enter an incorrect data type (e.g. letters for a numeric field), an error message is generated when that user tries to leave that textbox.

The error message is:

"The value you entered isn't valid for this field. For example, you may have entered text in a numeric field or a number that is larger than the fieldsize setting permits."

How can I change the text of the error message this generates?

I don't know what events are fired when the user tries to move to the next textbox.

Any help is appreciated!

Jason
 
Try putting error handling in the Before Update event of the textbox.

Randy
 
Have a look at the Error event of the form object.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi Randy,

Thanks for the suggestion! Unfortunately, the error gets generated before the BeforeUpdate event of the textbox is fired, so that won't work for me ...

Hi PH,

I looked at the error event of the form object. I added code to the event to put a messagebox up when the event fired. When I tested it out (by putting an "a" in the textbox that needs a number in it, then trying to move out of that textbox) it puts my messagebox up and then puts up the messagebox with the original error message. So my question is, what might I put in the code for that event to prevent the original message from coming up?

Thanks alot,

Jason

 
In the VBA help for this event procedure have a look at the Response parameter.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PH,

the vba help for a form's error event was exactly what I needed!

Woohoo!

Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top