Error Handling

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Sql 2000 and Access 2002.

I have a Maintenance database that has a button when clicked sends a report
as a e-mail attachemnt.

The problem I'm having is if someone uses the database that their e-mail
profiles isn't setup on.

When they click the button they get two errors:

You cannot create a new MS Outlook profile at this time. To create a new
profile...

and

No profile have been created. To create a new profile, use the Mail icon in
the Control Panel.

Is there a way to replace these error message with a custom error message
using error handling?

Thanks for the help,

Paul
 
Yes,
first you need to find out what the error numbers are that cause the error.
One way to do that is to create your error routine for the procedure, and put
a break point on the first line of executable code in the error routine.
There you will find the error number(s). Then, in your error handler"

My_Error_Routine:
If Err.Number = ???? Then
msgbox "What Ever You Want to Do or Say"...
Else
whatever you do for an unhandled error
endif
GoTo Main_Rtn_Exit
End Sub
 
Back
Top