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

Checking times

Status
Not open for further replies.

BeanBob

Programmer
Nov 26, 2000
20
GB
Hi, I have a database which holds information about some electrical equipment, some needs to be tested every month, every 2 months, etc.
I have 2 fields, Date last checked and Next check date...with combo box for the "checking period"
How do I get it to work out the Next Check date and how do I make it popup a message box 5 days before it's due to be checked??
Thanks SOO much to anyone who responds to this. It will be sooo helpful for my coursework!
Paul
 
you will need to use the DateAdd() function. Is your checking period always going to be in months or can it vary from weeks, months, years etc. Depending on this will depend on how you use the DateAdd() as you need to specify what type of timescale your using.

Something like

CheckDue = dateadd("m",[ComboName],[LastCheck])

Replace the names to fit your fields or textbox names.I assumed you kept the combobox simple with just months as the option and a numeric integer value stored.

The second part can be done, but when would you want the check to be made? When the database first opens or when the user chooses to check? If the want the first option then put the code into an autoexec macro or module otherwise you will need to link it to a button or event.

You will need to create a query displaying all the info you require to be displayed and put the following line into the criteria of your Check_Due field:

now()> Dateadd("d",-5,[Check_Due])

Hope this helps

Ian
 
Thank you so VERY much!! Worked absolutely fine!!
You're a star!!
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top