Here is what I'm trying to do and maybe I'm going about it all wrong .
I have a form [Vacationapproval] bound to tb.vacation with fields [datehired][daysrequested] [daysallowed] [daysused] [anniversarydate] and [employeenum]
[anniversarydate] is calculated by an update query that simply copies the [datehired] and changes the year to the current year .
I need to show the user ( on this form) the amount of vacation days that are remaining available to that user . Days are based on [daysallowed]-[daysused] bewteen last anniversary date and Now () .
Tricky part is there needs to be an if statement ,
if last anniversary is before Date() then Sum of [daysallowed]-[daysused] bewteen last anniversary date and Now ()
Else Sum of [daysallowed]-[daysused] bewteen anniversary date+ DateAdd "d", -365 and Now ()
I want to run the query based on a field [employeenum] after update using the current record in the form and pass the contents of field [employeenum] to the query as a parameter , the returned number [daysavailable] would be in another text box on the same form