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

Error message processing help needed

Status
Not open for further replies.

SCubed

Programmer
Jan 6, 2004
26
US
I am trying to give meaningful error messages to the users. However, I cannot determine how to know what error message is being returned from Access. Do I use the "err." object? If so, where do I find a list of possible values? All my Access books are worthless!

Thank you!
 
If you are wanting to raise errors within the code, you use the Err Object for that. If however, you are wanting to return error messages to users, the more friendly way to do that is by using the "MsgBox" function.

Example:

Msgbox "You have enter a date that has not yet occured.", 48

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
When the going gets tough, the tough gets going.
 
I'm wanting to grab the internal message (.err object) and then display the message to the user using MsgBox. My question is, where do I get more info about the .err object? There is nothing in the help file or any of my manuals.

Thanks again!
 
As a fair starting point, you can goto the help file from the form side of Access, then work you way down the topics:

Microsoft Access Help
Programming in Visual Basic
Visual Basic Language Reference
Objects
Err Object

As far as the code would be, you can try something like the following:

On Error Goto ErrHandle
.
.
.
ExitSub:
Exit Sub
ErrHandle:
Msgbox Err.Description, 48
Resume ExitSub
End Sub

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
When the going gets tough, the tough gets going.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top