Faio,
From the example you gave, it is not clear what you are referring to as
the "due date". But the basic concept of "how" to do this is reasonably
straightforward. For example, you might end up with code that looks
something like this...
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("SELECT [Name] FROM Employees WHERE
[DueDate] = Date()+2")
Do Until rst.EOF
DoCmd.SendObject acSendNoObject, , , "(e-mail address removed)", , , "almost
due", "'" & ![Name] & "' is due in 2 days!"
Loop
rst.Close
Set rst = Nothing
However, you will need to decide "when" this will happen. If the
database is opened afresh every day, but normally only once per day, you
could put the code on the Open event of a form which always opens when
the database opens. Or, you might rely on the user of the database to
manually run this by clicking a command button. Or, you might need to
have a table where the process also updates a date field to the current
date, and then refer to this field within another If...Then clause
within the code, to ensure that the same email only gets sent once. Or,
if the database does not get used every day, you might need to use
Windows Task Manager, or some other scheduling utility, to run it via a
command line which opens the database and activates a macro. So you
see, a lot depends on the usage of the database and your specific
requirements.
--
Steve Schapel, Microsoft Access MVP
Can anyone suggest a way to do this?
I have an employees database which is something like this.
PF#, Name, Startdate, Increment date.
----------------------------------------
20041, John, 30/1/2004,30/1/2004
Whenever the now() date is 30/1/2005 or 2 days before the due date, a
notification message will be send to this address (e-mail address removed).
Can anyone help me on this?