Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendObject Automatically

Status
Not open for further replies.

DaveHam

Technical User
Jul 5, 2000
4
US
I'm new to Visual Basic and my project is to get Access to recognize the date in a field and send an e-mail only if the current date [Date()] matches the date entered in the field. There is a different date for each record (all in the future) so I want this to be a continual process well into the future.&nbsp;&nbsp;I've gotten the code for the sendobject, but how do I write the If/Then statement that tells Access when to trigger it?&nbsp;&nbsp;&nbsp;<br>Thanks for the help!<br><br>David
 
Assuming [text1], and [text2] hold the values in question...<br><br>Private Sub Text1_OnExit() 'heres where we launch the DoCmd<br><br>If Format([text1],&quot;mm/dd/yyyy&quot;) = Format([text2],&quot;mm/dd/yyyy&quot;) Then<br>&nbsp;&nbsp;&nbsp;DoCmd.SendObject,,,,,,<br>&nbsp;End If<br>End Sub<br>Couple of things here. Both values must be valid date data types. Use the input mask wizzard, and use the 'short date', then add two additional zeros (y2k!). This keeps the users on track when entering dates.<br><br><br> <p>Amiel<br><a href=mailto:amielzz@netscape.net>amielzz@netscape.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top