Calculating Date

Dummy

Dummy User
Local time
Today, 14:33
Joined
Mar 7, 2005
Messages
25
hi,
Check the attached File,
i have a form with 2 text box, one is entry of Date Employed
and after update the second text box calculating the current system date will subtract both years to display how many years Employee worked

i've put =Date()-[DateStartedJob] After update of first text box and not worked and for sure not worked

can anyone help me please

thank you
 

Attachments

Last edited:
I would use the DateDiff function; details in Help.
 
Put the code in the After Update event of the date field like this:-
Code:
Private Sub DateStartedJob_AfterUpdate()

   [b]Me.Text1 = Int((Date - [DateStartedJob]) / 365.25)[/b]

End Sub

The Int() function returns the interger number of years.
.
 

Attachments

Users who are viewing this thread

Back
Top Bottom