Hi, Access 2003. I have a DB that contains deadlines data. I have the DB set up to create a report for each person that has deadline within a certain time frame. I need to automate the DB so an email is sent when a report exists but an email is not sent if there is no report for people. I have CDO code that works great except for the do not send part. The following is that part of the code. Any help would be appreciated. Thanks!
Code:
With iMsg
Set .Configuration = iConf
.To = "bjo@propeople.org"
.CC = "bjo@propeople.org"
.From = "bjo@propeople.org"
.Subject = "Please read: test CDOSYS message with Attachment3"
.HTMLBody = strHTML
'.Err.Clear
On Error Resume Next
Set Object = Expression
If Not IsMissing("G:\Accounting\Development\rptMiller.txt") Then
Set Attach = .AddAttachment("G:\Accounting\Development\rptMiller.txt")
End If
If Attach = 0 Then
Cancel = True
Else: .Send
End If
Comment