L
Linda Ribbach
Hi,
When the dates are the same, it still sends the email. I only want an email when there is no match. What did I do wrong?
Private Sub Form_Load()
Dim db As Database
Dim rec1 As Recordset
Dim rec2 As Recordset
Set db = CurrentDb
Set rec1 = db.OpenRecordset("tblRunLog")
Set rec2 = db.OpenRecordset("tblRidCountLog")
rec1.MoveLast
rec2.MoveLast
If rec1![RunDate] <> rec2![ImportDate] Then
DoCmd.SendObject acForm, "frmRunLog", "MS-DOSText(*.txt)", "(e-mail address removed)", "(e-mail address removed)", "", "Daily Org Request Run", "There was no data for this date", False, ""
End If
rec1.Close
rec2.Close
db.Close
Set db = Nothing
DocName = "frmRunlog"
DoCmd.Close A_FORM, "frmRunLog"
End Sub
Thanks in advance.
Linda
When the dates are the same, it still sends the email. I only want an email when there is no match. What did I do wrong?
Private Sub Form_Load()
Dim db As Database
Dim rec1 As Recordset
Dim rec2 As Recordset
Set db = CurrentDb
Set rec1 = db.OpenRecordset("tblRunLog")
Set rec2 = db.OpenRecordset("tblRidCountLog")
rec1.MoveLast
rec2.MoveLast
If rec1![RunDate] <> rec2![ImportDate] Then
DoCmd.SendObject acForm, "frmRunLog", "MS-DOSText(*.txt)", "(e-mail address removed)", "(e-mail address removed)", "", "Daily Org Request Run", "There was no data for this date", False, ""
End If
rec1.Close
rec2.Close
db.Close
Set db = Nothing
DocName = "frmRunlog"
DoCmd.Close A_FORM, "frmRunLog"
End Sub
Thanks in advance.
Linda