You can set conditions in code that allow email only if they are true.
I have a table that stores the last date email was sent. My code only sends the email at particular time of day every Monday except during winter months it's only monthly and if the saved date is not current date and only if I am the one opening project. My code:
Code:
If Me.tbxUser = "HJF" Then
If Not IsNull(DLookup("DateEnter", "UserComments", "Isnull(DateReview)")) Then DoCmd.OpenTable "UserComments"
If Format(Now(), "hhmmss") <= "080000" And Weekday(Date) = 2 And ((Month(Date) >= 6 And Month(Date) <= 9) Or Month(Date) <> Month(DLookup("ConstructionExtract", "Updates"))) Then
ConstructionExtract
End If
End If
Construction Extract is the procedure that has the email code. Last line in that procedure is:
CurrentDb.Execute "UPDATE Updates SET ConstructionExtract=#" & Date & "#"