Thanks Lancem,
Where do I put this code? Before Update or After Update?
i am making the calculation
(=[Maintenacedate]+((([MaintenaceHour]-[MachineHour])/[WeeklyHourWork])*7))
on the control source of the text box, should i change it?
"Lance" escreveu:
> You can find the difference between two dates with the datediff function.
>
> If DateDiff("d", <START_DATE> ,END_DATE>) > 365 then
> <Whatever happens when it's greater>
> else
> <Normal processing>
> end if
>
> "Josué" wrote:
>
> > Good afternoon, i need some help with the following:
> > I have a maintenace DB, i have the following fields MachineHours (long int),
> > MaintenaceHours (long int), MaintenaceDate (date) and WeeklyHourWork (long
> > int). I have a text box NextMaintenace (date) where i calcute the date of the
> > next maintenace based on the date of the maintenace (MaintenaceDate)
> > difference between MachineHours, MaintenaceHours and WeeklyHourWork.
> > example:
> > if MachineHours=4000, MaintenaceHours=7000, MaintenaceDate=26-10-2007,
> > WeeklyHourWork=40
> > then
> > NextMaintenace=15-03-2009
> > This works fine but I need to put a limit to this MaintenaceDate so it can´t
> > be bigger than 1 year (365 days).
> > I've tried using IF-THEN-ELSE conditions but it didn't work very well.
> > Can somebody give me a clue how to do this?
> >
> > Thanks in advance
> >
> >
|