Date calculation

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

Guest

I have a form that has a hire date field and a inservice date field. I want to calculate the next inservice date. Inservice is once every year. The problem is some people have not been to any inservice. I would like for this to show on the form so I can make reports showing who is required inservice. I don't know much about VB. I am using Office 97.
 
Add a textbox to your form to contain the next inservice date. Open the Properties window for the new textbox and the Control Source type
= DateAdd("yyyy", 1, [Me].[InservDate]
where Inserv is the name of the control already on your form that contains the last inservice date

HT

Tom

----- VKeller wrote: ----

I have a form that has a hire date field and a inservice date field. I want to calculate the next inservice date. Inservice is once every year. The problem is some people have not been to any inservice. I would like for this to show on the form so I can make reports showing who is required inservice. I don't know much about VB. I am using Office 97.
 
I left something out of my orginal question. I have 2 fields both are date fields. One is called Hire Date and the other is called In-service. For the people who have had in-service, I want the next in-service date to be 1 year after that date. If they have not been to any in-service I want the calculation to be from the Hire Date. Sorry for the confusion.
 
I left something out of my orginal question. I have 2 fields both are date fields. One is called Hire Date and the other is called In-service. For the people who have had in-service, I want the next in-service date to be 1 year after that date. If they have not been to any in-service I want the calculation to be from the Hire Date. Sorry for the confusion.

You could use an expression like

DateAdd("yyyy", 1, NZ([In-service], [Hire Date]))

NZ will return the date in InService if it exists; if that date is
NULL it will use Hire Date. DateAdd will add a year to it.
 
Back
Top