Link to home
Start Free TrialLog in
Avatar of mvalencia2003
mvalencia2003Flag for United States of America

asked on

Access 2013 E-mail Notitification

I have a database of users and when access will expire, is there a way to set up Access 2013 to send me an e-mail when someone's access will expire ,, ?  - About 10 days before it does ..
?

Columns I made are : Last Name , First Name , ... ... , E-mail address , ... ... ... , Expiration Date
-


?
?

Thanks
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Code like this should do what you need:

Private Sub Command0_Click()
'You may wish to purchase a product like this:
'http://www.contextmagic.com/express-clickyes/
'...to avoid the emal warming
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("qry10DayExp")
rst.MoveFirst
Do Until rst.EOF
    DoCmd.SendObject acSendNoObject, , , rst!emailAddress, , , "Expiration", "You will expire in " & rst!DaysTilEXP & " Days, on " & rst!ExpirationDate, False
    rst.MoveNext
Loop

MsgBox "Done"
rst.Close
dbs.Close
Set rst = Nothing
Set dbs = Nothing

End Sub


sample attached as well
Database67.mdb
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You may approach like this:

1 Set a timer event to run a daily procedure to find qualified records, and save to/update a table.
2 Another timer event to run a  function to read the table and send qualified emails.
3 Flag the table to show that a notification was issued.
4 Tou may improve the process to schedule how and when to resend notifications.