H
H0MELY
Greetings, thank you very much to all who are reading this. Basically I have
an automated email that goes out every Monday. Very simply it uses
sendobject to email a query. I would like to add some logic that basically
looks at the record count and if it isn't null...sends teh email as is...if
the record count is empty I would like to have it send an email that
basically says "The record set this week is empty."
Below is the module converted from the original macro. I was having trouble
modifying the module so any help would be greatly appreciated. Thanks in
advance for any ideas.
Option Compare Database
'------------------------------------------------------------
' macro2
'
'------------------------------------------------------------
Function macro2()
On Error GoTo macro2_Err
DoCmd.SendObject acQuery, "Override - Invoice comments",
"MicrosoftExcelBiff8(*.xls)", "(e-mail address removed)", "", "", Eval("(Date()-7) &
"" to "" & (Date()-1) & "" - Overrides granted in TEMS"""), "", False, ""
DoCmd.Quit acExit
macro2_Exit:
Exit Function
macro2_Err:
MsgBox Error$
Resume macro2_Exit
End Function
an automated email that goes out every Monday. Very simply it uses
sendobject to email a query. I would like to add some logic that basically
looks at the record count and if it isn't null...sends teh email as is...if
the record count is empty I would like to have it send an email that
basically says "The record set this week is empty."
Below is the module converted from the original macro. I was having trouble
modifying the module so any help would be greatly appreciated. Thanks in
advance for any ideas.
Option Compare Database
'------------------------------------------------------------
' macro2
'
'------------------------------------------------------------
Function macro2()
On Error GoTo macro2_Err
DoCmd.SendObject acQuery, "Override - Invoice comments",
"MicrosoftExcelBiff8(*.xls)", "(e-mail address removed)", "", "", Eval("(Date()-7) &
"" to "" & (Date()-1) & "" - Overrides granted in TEMS"""), "", False, ""
DoCmd.Quit acExit
macro2_Exit:
Exit Function
macro2_Err:
MsgBox Error$
Resume macro2_Exit
End Function