Access 2002
In Access 2002, how can I click on a command button and send an email containing an excel spreadsheet with the results of a query? The query should be ran at the same time. Can this be done?
Thanks
Web Development
In Access 2002, how can I click on a command button and send an email containing an excel spreadsheet with the results of a query? The query should be ran at the same time. Can this be done?
Thanks
by iht4
Try the following command
expression.SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject, MessageText, EditMessage, TemplateFile)
Examples as shown in help file: This code includes the Employees table in a mail message in Microsoft Excel format and specifies To, Cc, and Subject lines in the mail message. The mail message is sent immediately, without editing.
DoCmd.SendObject acSendTable, "Employees", acFormatXLS, _
"Nancy Davolio; Andrew Fuller", "Joan Weber", , _
"Current Spreadsheet of Employees", , False
Change the acsendtable to acsendquery should provide you with the result you are looking for.
Good luck
by makita
Poster rated this answer.
by makita
This discussion is closed to new replies.
Sort by Trending