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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Altering code for a reminder

Status
Not open for further replies.

cwbviper

Technical User
Oct 22, 2002
101
GB
Hi there,

I created a Personnel Database at work and set up a button which will email our company administrator when a staff members contract is up for renewal. At the moment this only works if the contract is up for renewal exactly 6 weeks from the current date.

This is the code i have used,

Set rst = CurrentDb.OpenRecordset("SELECT * from [Initial Registration] WHERE [End Date Of Funding] = #" & Format((DateAdd("w", 6, Date)), "mm/dd/yyyy") & "#")

Is it possible to set up the code to email when the contract is up for renewal at any point in the 6 weeks as oppose to exactly 6 weeks from the current date?

Cheers

Colin
 
Hi

You can do this quite easily by changing the = symbol on the second line of the post to <, but you will then find that it gets triggered every time that the button is clicked, so I would add a flag to indicate whether it has been sent, and put extra code into the button to set the flag to true to stop it being sent again.

John
 
Cheers for the help John,

I'll give it a try.

Colin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top