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

ErrHandler Executed 1

Status
Not open for further replies.

SpankYou

Programmer
Feb 24, 2003
211
GB
Well I have written some standard error handling code, to control a certain error which looks fine, but when I exit the form I get my programmed list of questions come and then a message box conforming to the error detection message box I've written. Basically the code seems to be executing my error handler when there isn't an error. When I don't have the error code in the module it works fine. A small problem but confusing.

My code is...

ErrHandler:
'Trap for Cancel the Event
If Err.Number = 287 Then
MsgBox "No messages will be sent as you have chosen not to send any this time." & vbCrLf & "To send these emails please go through the process again.", vbOKOnly, "Email Deactivation"
Resume ErrExit
Else
MsgBox Err.Number & " : " & Err.Description
'DoCmd.Close
Exit Sub

End If

ErrExit:
DoCmd.Close

The error I recieve is

"0: "

Any Ideas?

Cheers for any help

Sam
 
Hi Sam
Do you have the method in place to exit your routine before the code executes your error handling after running smoothly?

EG
sub dosummat()
on error goto handler
do things
exit sub
handler:
"Error Occurred"
resume next
end sub


If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Erm I have now D'oh 5 years has taught me nothing back to the tutorials,

Cheers

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top