Email generator

  • Thread starter Thread starter gudiya
  • Start date Start date
G

gudiya

Hi,

I have a products database and i want to generate email warning when
the products expiry date is approaching.I have no idea how to do this??
Please help me asap.
 
You'll need to use a form event when the application opens each day to check
for any record which are applicable. Build a recordset and check the
recordcount. Something like:

Private Sub cmdTickler_Click()
'********************************************************************
' Name: cmdTickler
' Author: Arvin Meyer
'********************************************************************
On Error GoTo Err_cmdTickler
Dim rstTicklerItems As DAO.Recordset
Dim db As Database
Dim lngCount As Long

Set db = CurrentDb
Set rstTicklerItems = db.OpenRecordset("qryTicklerOnItem", dbOpenSnapshot)

lngCount = rstTicklerItems.RecordCount

If lngCount > 0 Then
If MsgBox("You have records that need attention." & _
vbCrLf & "SHOW THEM?", vbYesNo, "Check Records") = vbYes Then

DoCmd.OpenForm "frmTicklerRecords"

End If
End If

Exit_cmdTickler:

rstTicklerItems.Close
Set rstTicklerItems = Nothing
Set db = Nothing
Exit Sub

Err_cmdTickler:
MsgBox Err.Description
Resume Exit_cmdTickler
End Sub
--

Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top