Results 1 to 6 of 6

If,Then Email

  1. #1
    nherbert31 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2017
    Posts
    5

    If,Then Email


    Hello,

    I was wondering if it was possible to do an "If, Then" data macro where if the 90Day field in my access database form equals today then an email will be sent to the associated employee. I have the emails listed in every record of the employees.

    Attachment 29858
    Attached Thumbnails Attached Thumbnails Email.png  

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    41,130
    I expect so, since If conditional and SendEmail action are available. However, which data macro event would you suggest this goes in - AfterUpdate? Have you even tried?
    To provide db: Make copy, remove confidential data, run compact & repair, zip w/Windows Compression if over 500KB (2MB zip allowed), attach to post. Attachment Manager is below the Advanced post editor window, click Go Advanced below the Quick Reply window.
    If any suggestion resolves your issue, please use the Thread Tools dropdown above first post and mark as Solved!

    Debug!Debug!Debug! http://www.cpearson.com/excel/debug.htm

  3. #3
    nherbert31 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2017
    Posts
    5
    I did try and left the event under "<Value>". I could not find a "SendEmail" action, there was only a "EmailDatabaseObject" which sends a database object to a specific person. I want this data macro to pull the correct email from the "Email" field when the "90Day" field equals todays date that includes an automated message such as "This is a 90 Day reminder for...".

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,031
    Typically to send out reminder emails, you would want to do this in a separate database that is linked to your table using the PC task scheduler. Create task to run once a day that opens this new database. Create one form that gets opened when database is opened and in the OnOpen event, put code to do your emails if they match the date criteria. Then at the end of the code put in Docmd.Quit so it closes the database and waits until the next scheduled run.

  5. #5
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,031
    Here are a few links others have posted that might help with emails.

    http://www.granite.ab.ca/access/email.htm

    http://www.accessforums.net/showthread.php?t=21555

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    41,130
    Then you aren't looking at a Data Macro design, just a regular macro.

    Do you want to send email when record is created? Or send a batch of emails every day?
    To provide db: Make copy, remove confidential data, run compact & repair, zip w/Windows Compression if over 500KB (2MB zip allowed), attach to post. Attachment Manager is below the Advanced post editor window, click Go Advanced below the Quick Reply window.
    If any suggestion resolves your issue, please use the Thread Tools dropdown above first post and mark as Solved!

    Debug!Debug!Debug! http://www.cpearson.com/excel/debug.htm

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

Similar Threads

  1. Replies: 7
    Last Post: 08-01-2017, 05:38 PM
  2. Replies: 2
    Last Post: 05-23-2016, 12:28 PM
  3. Replies: 3
    Last Post: 12-28-2015, 03:11 PM
  4. Replies: 5
    Last Post: 05-07-2014, 08:25 AM
  5. Replies: 1
    Last Post: 05-01-2014, 10:37 AM

Posting Permissions

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