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

Customize Error Messages

Status
Not open for further replies.

Alibaba2003

Programmer
Mar 31, 2003
67
US
Hi,
How do I customize access default error messages. For example when a user enters does not enter a required field access produces the message: "You cannot add or change a record because a related record is required in table .."

I want to change that specific error or alert to a friendly message?

Thanks
Tareq

It's Nice to Be Important But It's more Important to BE Nice
 
Have a look at the Error event procedure of the Form object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi!

There are several types of errors, that generates messages. The most common, are run time errors, which occurs when something "happens" within code.

This is not runtime errors, but what's referred to as form errors, which are basically the same, numbers, messages 'nall, but needs to be trapped through the forms on error event.

What you do, enter the forms on error event, enter some code like the following:

[tt]if dataerr = <your number> then
msgbox "your custom message..."
response = acdataerrcontinue
end if[/tt]

- now - to find "your" dataerr number, use

[tt]msgbox dataerr[/tt]

within the form error event, then replace it in the above code. The line response = ... is also important, cause it's the one telling Access not to show the default thingie...

Roy-Vidar
 
OK thanks .. the solutions take care of it on a form by form basis. This may require lots of work. But what if I want to replace the original message coming from access. How do i do that?

It's Nice to Be Important But It's more Important to BE Nice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top