Sending email

  • Thread starter Thread starter EMILYTAN via AccessMonster.com
  • Start date Start date
E

EMILYTAN via AccessMonster.com

Hi,

I have a function which acts almost the same function as loan function.
Does anyone know to make it autosend an email when the expire due date still
left 1 day?
 
Hi,

I have a function which acts almost the same function as loan function.
Does anyone know to make it autosend an email when the expire due date still
left 1 day?

I'm not sure what the "loan" function is, but you can have Access examine the Expire date and send an email:

Dim rst As ADODB.Recordset
Dim strBody As String

Set rst = New ADODB.Recordset
rst.Open "SELECT EmailAddress, YourDateField FROM SomeTable WHERE DateDiff("d", YourExpireDateField, Now) <=1",
CurrentProject.Connection

If Not (rst.EOF and rst.BOF) Then
'/build the body
strBody = "Your xxx is set to expire tomorrow. Please renew or else"
DoCmd.SendObject acSendNoObject, , , rst("EmailAddress"), , , "Expire Notice", strBody
End If

Set rst = Nothing


Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Back
Top