If, by chance, your company is still using old versions of Windows and Outlook (which thankfully (in this case only) mine does), you can have the email sent automatically using
with the EditMessage argument being False. If your company uses newer versions of Windows and Outlook, this isn't as easy, as Microsoft have "fixed" this very useful "bug", and don't allow sending without user intervention.
So you'll end up with code like:
Code:
DoCmd.SendObject acSendQuery, "YourQuery", _
acFormatXLS, "Someone@somewhere", , , "Some Subject", _
"Some Body Text", False
DoCmd.Quit
If you have an autoexec macro run that code on startup, it will send that query, then quit when the database is opened.
If you don't want to use an autoexec macro, you can use another macro, and specify that in the startup parameters of your schedule - eg:
"C:\Program Files\Office\msaccess.exe" "X:\YourFile.mdb" /x macrotorun
HTH
Steven
I am a loud man with a very large hat. This means I am in charge