R
reterrig
I have a form "A" and two subforms "B" & "C". in the subform "b" i have a
control box "TotalDays" calculating the number of days between two day
fields. In the subform "C" I have the following fields:
"20FreeDaysReefer"
"20From1", "20To1"
"20From2", "20To2"
"20From3", "20To3"
"Rate1"
"Rate2"
"Rate3"
I need the following to be shown in a control box "1st20refreg1" of the "C"
subform for the first row i.e. "20From, "20To1":
If "TotalDays"<"20From1" then "0"
If "TotalDays" Between "FreeDays" And "20To1" then
("TotalDays"-"20FreeDaysReefer")*"Rate1"
If "TotalDays">"20To1" then ("20To1"-"20From1")*"Rate1"
If "20To1" = "over" then ("TotalDays"-"20From1")*"Rate1)
If "Rate1" is null then "0"
I have tried following formula in the Source of the control box
"1st20refreg1" but I get always wrong results i.e. it works when when
"TotalDays" is between "FreeDays" and "To1" but does not work for the other
assumptions:
=IIfIsNull([Rate1];"0";IIf([20To1]="over";"0";IIf([TotalDays]<[20From1];"0";IIf([TotalDays]>=[20From1]
And
[TotalDays]<=[20To1];([TotalDays]-([20From1]-1))*[Rate1];([20To1]-[20From1]+1)*[Rate1]))))
I work on Access 2003 and accepts only semicolons rather than commas
I need your assistance please
Thanks
Peter
control box "TotalDays" calculating the number of days between two day
fields. In the subform "C" I have the following fields:
"20FreeDaysReefer"
"20From1", "20To1"
"20From2", "20To2"
"20From3", "20To3"
"Rate1"
"Rate2"
"Rate3"
I need the following to be shown in a control box "1st20refreg1" of the "C"
subform for the first row i.e. "20From, "20To1":
If "TotalDays"<"20From1" then "0"
If "TotalDays" Between "FreeDays" And "20To1" then
("TotalDays"-"20FreeDaysReefer")*"Rate1"
If "TotalDays">"20To1" then ("20To1"-"20From1")*"Rate1"
If "20To1" = "over" then ("TotalDays"-"20From1")*"Rate1)
If "Rate1" is null then "0"
I have tried following formula in the Source of the control box
"1st20refreg1" but I get always wrong results i.e. it works when when
"TotalDays" is between "FreeDays" and "To1" but does not work for the other
assumptions:
=IIfIsNull([Rate1];"0";IIf([20To1]="over";"0";IIf([TotalDays]<[20From1];"0";IIf([TotalDays]>=[20From1]
And
[TotalDays]<=[20To1];([TotalDays]-([20From1]-1))*[Rate1];([20To1]-[20From1]+1)*[Rate1]))))
I work on Access 2003 and accepts only semicolons rather than commas
I need your assistance please
Thanks
Peter