Error 2051 - Cancel SendObject

i didnt make any adjustments

i just noted that if you have error handlers, without a resume statement, and one of these has fired - then your attempt to set the error handler in the email routine will be ignored. I found one example of an unfinished error handler, but didnt check the rest of the database (eg what IS error 3020)

so i wondered whether in your work environment, you were encountering an error of some sort - that you may not even be aware of, because it was handled by your code, but that was then preventing the error handler being set in the email code section, becuse you had no resume statement (so effectively you have never left the first error handler). perhaps you should put msgboxs in all your error handlers while you are debugging this to see if one is firing for some reason.
 
i will put in the message boxes and see
error 3020 is Update or CancelUpdate without AddNew or Edit.
Thanks for your Patience (an nhs pun there lol)
 
it could be that

when i was testing it, i had problems entering the email bits correctly, whicxh may have caused errors.
 
msgbox in all error handlers still no joy.
still displays runtime error 2501, but wont go into the error handling routine.
 
i have just realised, on the works computer it is running the Express ClickYES program which stops the macro security message from outlook ( a program is trying to send a message on your behalf) from being displayed,
Would this interfere with the Error handling routine.
 
dont know - perhaps it cancels the email without raising an error
 
thanks to all for your help.
Have decided to set email to be sent without being displyed first in do sendobject
Cant see a way round this problem
 
it seems none of my on error processing is working. the access message showing runtime error is always displayed not the message from the on error routines.
Am i missing something here
 
THe Error processing works fine on other computers at work.

I think the problem must lie with my installation of access.

Thanks again to all who have helped in this problem

pat
 

Users who are viewing this thread

Back
Top Bottom