change error messages

bauer

Registered User.
Local time
Today, 15:57
Joined
Aug 23, 2001
Messages
77
I'm trying to figure out how to change the error messages for a multi user application. The big problem is I'm fixing up someone elses work, and I don't want to redo it by putting in my own buttons, rather just by changing the error messages.
Thank you
 
Changing error messages generally means trapping them and then saying whatever it was that you wanted to say in place of what the default error handlers say.

If you look at the code generated by most "button wizards" all they do is generate the action code and some logic to handle errors as a trap. Inside the default trap code they just do an elementary MsgBox function with Err.Description as the message. By taking all other defaults, the message box is automatically untitled and is an OK-only case.

Without changing the form's buttons, you can add code to each button's trap handler to make it say something else besides the default message in Err.Description.

I.e. you can write a "Select Case Err.Number" and trap specific errors by number, take whatever action you want, and do a "Resume Next" or a "Resume <label>" for them. You can also still leave the "MsgBox Err.Description" for the "Case Else" code.

May I suggest reading the Help on the Err object as at least a starting place? Also look up Error Handling. You will get ten or eleven sub-topics to read through. Some of them also include example code.
 
Just one point, the previous guy did not put in buttons for the most part, he pretty much just used the bottom record bar that comes by default on a from. Please help me,
thank you
 
Acctually, I found out where to put my error messages, but I just can't figure out how to do it. I am using the On Error event, but I think I have two errors that come up consecutively and only the first one is handled by mine

Please help

thanks
 

Users who are viewing this thread

Back
Top Bottom