calculating from 2 dates

  • Thread starter Thread starter Kay Davies
  • Start date Start date
K

Kay Davies

Hello - can anyone help me please

I am trying to calculate the number of day's holiday
someone has taken but subtracting the end date of the
holiday from the start date.

there are two boxes

hol 1 start date
hol 1 end date

then the answer goes into an unbound box on the form which
is automatically filled in as the dates are entered.
Nothing I do seems to work so if anyone has any ideas I
would be grateful

thanks
Kay
 
There is a built in function called datediff function available that'll do
the subtraction for you.

you need to add an afterUpdate function to both your boxes something like

sub box1_afterupdate ()
dim result as integer
result = datediff("d", box1,box2)
box3.text = result
end sub
 
Back
Top