Access has the SendObject method that you can use to do this. Check the
online help for specific syntax on sending the message.
To determine the time interval, you can do something like this;
If DateAdd("d",-30,Date) > YourDateField Then
DoCmd.SendObject , , ,
[email protected]", , , "Time to Read the
Meter", "Get to work NOW", True
End IF
If you add this code to your Startup form's Load or Open event, it'll run
each time your database is opened. If you want to do this without
interaction, you'd have to build a new database, build a startup form that
included this code in the Load or Open event, set the form as your Startup
form, and then use the builtin Windows scheduler to "run" this database each
day ...
If you need to loop through a table to determine whether you need to send an
email or not, then you'll need to generate a recordset to do this:
Dim rst As DAO.Recordset
Set rst = CurrentDB.OpenRecorset("SELECT strEmail, strName FROM YourTable
WHERE DateAdd("d", -30, Date) > SomeDateField")
Do Until rst.EOF
DoCmd.SendObject ,,,rst("strEmail"),,,"Time to work","Get To Work", False
rst.MoveNext
Loop
Set rst = Nothing
However, be aware that calling SendObject in a loop can cause problems, and
that running code like this unattended will most likely cause Outlook to
prompt you with the standard security warnings ("Are you sure you want to
allow this?")