email query

  • Thread starter Thread starter ryan.fitzpatrick3
  • Start date Start date
R

ryan.fitzpatrick3

is there away to email a query? currently i have an export to excel
function which works fine but i'd like take it one step further and
make it where you can email that query result via email to whoever. is
this possible?
 
You would not want to email the query but rather the results of the query.
The easiest way is probably to create a report based on the query and then
email the report in snapshiot format.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
Hi Ryan

If you are happy with the default output formatting, then you can use
SendObject to email a query in Excel format:

DoCmd.SendObject acSendQuery, NameOfQuery, acFormatXLS, _
ToAddresses, CcAddresses, BccAddresses, _
Subject, MessageBodyText, EditMessage

If you are doing any fancy post-processing of the spreadsheet via Excel
automation, then you can use Outlook automation to create a message and
attach the Excel file you have created.
 
Back
Top