Automatic Emailling from Access 97

  • Thread starter Thread starter omoregbe
  • Start date Start date
O

omoregbe

Guest
Hi Everyone,

I am doing a project on restructuring a company's database.
One of the main task is an automatic email from the database (Access 97) to an email account.

The task is, staff should be able to set date and names for their next conact in the database (Access 97), and before that date, they should get a reminder in their email about that contact.

It sound so impossible with Access 97 :confused: , if any1 has got an idea on how to tackle this daunting task, please please let me know.

Thank You
Nick :)
 
It is certainly not impossible. There a a number of ways you could do this (all using VB code) ranging from the docmd.sendobject to using the outlook object library.

the docmd.sendobject is the easier method so search VB help for SendObject.

You will need to use VB (if you don't already) to check for the date of the contact and if it meets a certain criteria, fire off the e-mail.

There are loads of similar topics discussed here so use the search facility here initially and see what you can dig up.
 
omoregbe, this is a very simplified example of what you are trying but I think it may be the first step you need to take to get this working for you.

Try the following example but put your email address in place of the email@email.com
Code:
Dim dtOne As Date
Dim dtTwo As Date

dtOne = Date
' If you were using a control from the form
' you would do something like the following.
' dtTwo = Me.txtStoredDate

' Since this is an example we will hard code
' the date. Experiment with it by changing the
' date to something different.
dtTwo = "7/14/03" ' Todays date.

If dtOne = dtTwo Then
    DoCmd.SendObject , , , "email@email.com", , , _
        "Subject: Auto Notification", _
        "This email is being sent to you because " & _
        "the stored date of " & dtTwo & " matches " & _
        "todays date of" & dtOne & ".", True
    Exit Sub
End If
    MsgBox ("Date doesn't match")
    Exit Sub

This should send an email to you that looks like this: This email is being sent to you because the stored date of 7/14/2003 matches todays date of7/14/2003.
 

Users who are viewing this thread

Back
Top Bottom