Results 1 to 12 of 12
  1. #1
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156

    Send email remider 3 days before appointment

    I have a appointment database and I would like to have the database automatically send a email reminder with app date and time 3 days before the appointment. I have looked around and found code to send a email but no 3 days before the appointment. I am using Access 2016 m2 bit.



    Thank-you

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So the email date is the Appointment - 3 days, right? You dould use DateAdd() to get the trigger date.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You could open a recordset with a criteria to get the appropriate records. Loop that and send emails to each. Personally, I'd probably create a stand-alone db that did just this, and run it from Windows Scheduled Tasks every day.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  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,521
    Oops, slow fingers.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by pbaldy View Post
    Oops, slow fingers.
    They're probably tired from shoveling snow.

  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,521
    Quote Originally Posted by RuralGuy View Post
    They're probably tired from shoveling snow.
    Not so tired as yours must be, since I'm 3,500' lower.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156
    I will give the - 3 days a try. Does have any one have a good working code that I can work with.

  8. #8
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    you haven't provided enough info for anyone to provide code or an expression. Take a look at the DateAdd function here, though I think I'd use the DateDiff function (also available at the same web site) and send the email if the difference between Date() and the appointment date >= 3.
    https://www.techonthenet.com/access/...te/dateadd.php
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156
    Thank-you and yes you are correct I have not provided much info. I have attached a copy of the database.
    Attached Files Attached Files

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If I'm reading right, the SQL to pull appointments 3 days out looks like:

    SELECT tblAppointment.AppointmentID, tblAppointment.Subject, tblAppointment.StartTime, tblAppointment.EndTime, tblAppointment.Email
    FROM tblAppointment
    WHERE (((tblAppointment.StartTime)=DateAdd("d",3,Date()) ));



    I'd create a saved query with that SQL, open a recordset on it and loop the records, sending an email to each.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156
    Thank-you I will give that a try.

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem, post back if you get stuck.
    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. Replies: 3
    Last Post: 12-28-2015, 04:11 PM
  2. Replies: 5
    Last Post: 09-14-2015, 07:24 AM
  3. Send email using CDO, get email addresses from table
    By marvinac1 in forum Programming
    Replies: 3
    Last Post: 12-22-2014, 12:54 PM
  4. Replies: 5
    Last Post: 05-07-2014, 09:25 AM
  5. Replies: 4
    Last Post: 04-13-2011, 10:11 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
  •  
Other Forums: Microsoft Office Forums