G
Guest
I have a data entry form with 4 check boxes on it labeled, Overnight,
Weekend, Part Weekend, & Holiday. In the underlying query I have a field
called total minutes, which calculates the total minutes a processor spent on
a task.
If the data entry clerk checks the Overnight check box on the form, I want
the query to subtract 360 minutes from the total minutes field. If Weekend
is checked, 3240 minutes, Partial Weekend, 1800 minutes, holiday, 1800
minutes.
The form allows more than 1 check box to be selected (which is what I want),
but the query is only subtracting the minutes from 1st box that is checked
and ignoring additional check boxes selected.
How do I force the query to evaluate each of the check boxes and subtract
the corresponding number of minutes from the total minutes field?
Here is my IIf statement:
FnlMins:
IIf([tblMoEmb_P]![Overnight]=True,([tblMoEmb_P]![TotalNumMins]-360),IIf([tblMoEmb_P]![PartWeekend]=True,([tblMoEmb_P]![TotalNumMins]-1800),IIf([tblMoEmb_P]![Weekend]=True,([tblMoEmb_P]![TotalNumMins]-3240),IIf([tblMoEmb_P]![Holiday]=True,([tblMoEmb_P]![TotalNumMins]-118),[tblMoEmb_P]![TotalNumMins]))))
Weekend, Part Weekend, & Holiday. In the underlying query I have a field
called total minutes, which calculates the total minutes a processor spent on
a task.
If the data entry clerk checks the Overnight check box on the form, I want
the query to subtract 360 minutes from the total minutes field. If Weekend
is checked, 3240 minutes, Partial Weekend, 1800 minutes, holiday, 1800
minutes.
The form allows more than 1 check box to be selected (which is what I want),
but the query is only subtracting the minutes from 1st box that is checked
and ignoring additional check boxes selected.
How do I force the query to evaluate each of the check boxes and subtract
the corresponding number of minutes from the total minutes field?
Here is my IIf statement:
FnlMins:
IIf([tblMoEmb_P]![Overnight]=True,([tblMoEmb_P]![TotalNumMins]-360),IIf([tblMoEmb_P]![PartWeekend]=True,([tblMoEmb_P]![TotalNumMins]-1800),IIf([tblMoEmb_P]![Weekend]=True,([tblMoEmb_P]![TotalNumMins]-3240),IIf([tblMoEmb_P]![Holiday]=True,([tblMoEmb_P]![TotalNumMins]-118),[tblMoEmb_P]![TotalNumMins]))))