More automation in Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an automated emailer code set up so Access tells Outlook to send out
an email. I was wondering if I can link this automated email to a specific
field in my table so when the 'due date' in my field arrives, Access knows
it's time to tell Outlook to email?
 
Well, yes. You could use the events of a form (On Open, or On Current) to
check the value of your date control, then run your send email code.

If Me!myDueDate < Date() Then
'run my code
Else
End if


-Ed
 
Thanks, I'll try that out.

Ed Robichaud said:
Well, yes. You could use the events of a form (On Open, or On Current) to
check the value of your date control, then run your send email code.

If Me!myDueDate < Date() Then
'run my code
Else
End if


-Ed
 
I tried that expression you suggested and nothing happened. Perhaps I
entered it wrong, how do I tell the event On Open to read my code in VBA?
 
Not sure what your "send email" code is, but you should be able to just
insert it where indicated. Mine is:

'=================================
On Error Resume Next
DoCmd.SendObject , , , Me!, , , "Subject text"

If Err.Number = 2501 Then
MsgBox " Email message cancelled ", vbExclamation
End If

'==================================

where [email] is the text box control on the form containing the email
address.

-Ed
 
Back
Top