Results 1 to 6 of 6
  1. #1
    robphillips79 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    3

    AutoExec macro e-mail

    Hello,

    I have a 2013 Access Database that is used for daily reporting. It is scheduled to run through a Windows task. It simply opens, runs an Autoexec macro to output query data into a CSV file on a network share, and then closes. I'd like to have an e-mail sent to me after it runs letting me know if it was successful or not. Is this doable in an AutoExec macro? Any guidance would be appreciated. Thanks.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    I personally would use VBA, but you should be able to use SendObject in a macro to send an email. It would have to be able to be sent without user intervention.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    robphillips79 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    I personally would use VBA, but you should be able to use SendObject in a macro to send an email. It would have to be able to be sent without user intervention.
    Thank you for the reply, but I do not see SendObject as an action item within the Macro window. One thing I have thought of is to open a form that uses OnLoad VBA to send an e-mail, but in order to do that I need to provide enough time for the form to stay open and send the e-mail before the close action takes place. Is there a way to create a "pause" so that the e-mail has time to process?

    Thanks again.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    What version? I see it in 2007. I've got other versions on VM's.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    robphillips79 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    What version? I see it in 2007. I've got other versions on VM's.
    Access 2013. It appears you can only send email on data macros. I've gotten this to work however. Luckily, Access is letting the form load and send the e-mail before the close window action happens. All is good. Thanks for the replies.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    Glad you got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access AutoExec Macro Cannot Find Function
    By JuanTooTree in forum Access
    Replies: 10
    Last Post: 06-08-2023, 10:10 AM
  2. Autoexec Macro details?
    By cboshdave in forum Access
    Replies: 6
    Last Post: 11-20-2012, 01:46 PM
  3. Help Stopping AutoExec Macro
    By drewetzel in forum Access
    Replies: 2
    Last Post: 10-03-2011, 10:51 AM
  4. Out of control loop in autoexec macro
    By accessnewbie in forum Programming
    Replies: 2
    Last Post: 08-19-2010, 04:31 PM
  5. Using parameter in autoexec macro
    By lchurch in forum Queries
    Replies: 0
    Last Post: 03-04-2009, 06:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums