Email, report snapshots and changing code

All of the research I've done so far says what we are doing should work. What version of Access are you using and is your patch level up to date?
 
Using 2002, I do believe everything is up to date.
 
Will it still send to 1 email address that you hard code? Can you post the db after removing anything sensitive but leaving enough to demo the problem? I use 2002 also as my sig states. What email client do you use? Do you have all of your references?
 
Might be easier to take a look.... From the main switchboard.. View Notice/Tags then page2 tab is the command button for emailing reports.
 

Attachments

I am probably making progress. I changed our field to hard coded string and still get the same error so it is probably some other argument of the SendObject causing the problem.
 
You missed the Message argument. You have False in there and it would like a string.
 
You've lost me.............. The message text? This only appears in the message line of the email right?? That would stop the code? :confused:
 
Last edited:
I changed your line to:
Code:
DoCmd.SendObject acSendReport, "rptNewJob", "SnapshotFormat(*.snp)", _
EmailList(), "", Me!JobDescription, "Hello", [b]"The message",[/b] False, ""
and the error goes away. According to my help, that is the MessageText argument:
DoCmd.SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject, MessageText, EditMessage, TemplateFile)
 
Thank you!

Works now :) Had to flip 2 around to....
DoCmd.SendObject acSendReport, "rptNewJob", "SnapshotFormat(*.snp)", _
EmailList(), "", "", Me!JobDescription, "The message", False, ""
It was putting the Me!JobDescription in the BCC field.
Looks like things were a bit off in my original... Strange it was working before the function was added.
But again, thank you very much for putting the function together for me. Time for me to go back to my VBA book and learn more! I'm reading "Beginning Access 2000 VBA" seems good... Finished the first 4 or 5 chapters (twice:)) Took a trip to Canada and got side tracked.... This lets me know I need to get back to it!!
 
Glad to assist. The more you learn, the more you realize you need to learn. :)
 

Users who are viewing this thread

Back
Top Bottom