DaniBoy
Registered User.
- Local time
- Today, 13:26
- Joined
- Nov 18, 2001
- Messages
- 175
Hello,
Ok, I got the email thing to work, its now sending the report once every 24 hrs!!! yyeeeaaahhhh!!! BUT, jeje!!! I got another task to do:
I have the report to cancel if there in no data and the sendobject never sends an email, I want it to actualy send an email saying that there is no report for that day ect. This is what I did:
Report Event On No Data:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no Reports at this Time", , "AM Yard Waste Tracker", , , Cancel
Cancel = True
End Sub
Email Timer Event:
Private Sub Form_Timer()
If Format(Now(), "hh:mm:ss") = "12:24:00" Then
DoCmd.SendObject acSendReport, "PM Email Tracker Report", "Microsoft Excel 97-2002", "dcallejas@smtp.co.alachua.fl.us", , , "Trackers", , False
Else
DoCmd.SendObject , , , "dcallejas@smtp.co.alachua.fl.us", , , "No Report to Send", "There is no Report for Today", False
End If
End Sub
What happens when there is no report, it sends the email "No Report To Send" but it loops over and over again, and I have to shut down Access to stop it.
Why is it looping?
Did anyone tried this?
DaniBoy
Ok, I got the email thing to work, its now sending the report once every 24 hrs!!! yyeeeaaahhhh!!! BUT, jeje!!! I got another task to do:
I have the report to cancel if there in no data and the sendobject never sends an email, I want it to actualy send an email saying that there is no report for that day ect. This is what I did:
Report Event On No Data:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no Reports at this Time", , "AM Yard Waste Tracker", , , Cancel
Cancel = True
End Sub
Email Timer Event:
Private Sub Form_Timer()
If Format(Now(), "hh:mm:ss") = "12:24:00" Then
DoCmd.SendObject acSendReport, "PM Email Tracker Report", "Microsoft Excel 97-2002", "dcallejas@smtp.co.alachua.fl.us", , , "Trackers", , False
Else
DoCmd.SendObject , , , "dcallejas@smtp.co.alachua.fl.us", , , "No Report to Send", "There is no Report for Today", False
End If
End Sub
What happens when there is no report, it sends the email "No Report To Send" but it loops over and over again, and I have to shut down Access to stop it.
Why is it looping?
Did anyone tried this?
DaniBoy
Last edited: