T
TT
Hi there,
I'm sure this is a very easy question, but for some reason, I'm having a
problem figureing this out!!
On my main form (frmDetailReport), I have an unbound field called
txtUnitCount which is controlled by a combo box. When the user selects an
item from the combo box, txtUnitCount uses an appropriate DCount formula to
gather the unit count. This all works fine.
Secondly, I have a continuous subform (frmVenueDetails) with the following
information on it:
CategoryID (Integer)
Flat Rate (Yes/No)
Cost Per Unit (Double)
I have also created an unbound field called txtAmount on the subform whose
formula reads:
=IIf([FlatRate]=Yes,[CostPerUnit],[Forms]![frmDetailReport]![txtUnitCount]*[CostPerUnit])
This is basically saying, if the category is a flat fee, then just use the
amount in the CostPerUnit field. If it is not, then take the CostPerUnit
amount and multiply it by the txtUnitCount from the main form. This also
works correctly.
The problem I'm running into is summing up the txtAmount field. I'm
assuming that I can't just put an unbound field at the top of my form header
called =Sum([txtAmount]) as there really is no values for the field to sum
up. So I tried the following:
=Sum(IIf([FlatRate]=Yes,[CostPerUnit],[Forms]![frmDetailReport]![txtUnitCount]*[CostPerUnit]))
Using this formula, I get an #Error.
I'm sure it's something simple in my formula that I'm doing wrong, but if
someone could help me out, that would be great!!
Thanks in advance!!
I'm sure this is a very easy question, but for some reason, I'm having a
problem figureing this out!!
On my main form (frmDetailReport), I have an unbound field called
txtUnitCount which is controlled by a combo box. When the user selects an
item from the combo box, txtUnitCount uses an appropriate DCount formula to
gather the unit count. This all works fine.
Secondly, I have a continuous subform (frmVenueDetails) with the following
information on it:
CategoryID (Integer)
Flat Rate (Yes/No)
Cost Per Unit (Double)
I have also created an unbound field called txtAmount on the subform whose
formula reads:
=IIf([FlatRate]=Yes,[CostPerUnit],[Forms]![frmDetailReport]![txtUnitCount]*[CostPerUnit])
This is basically saying, if the category is a flat fee, then just use the
amount in the CostPerUnit field. If it is not, then take the CostPerUnit
amount and multiply it by the txtUnitCount from the main form. This also
works correctly.
The problem I'm running into is summing up the txtAmount field. I'm
assuming that I can't just put an unbound field at the top of my form header
called =Sum([txtAmount]) as there really is no values for the field to sum
up. So I tried the following:
=Sum(IIf([FlatRate]=Yes,[CostPerUnit],[Forms]![frmDetailReport]![txtUnitCount]*[CostPerUnit]))
Using this formula, I get an #Error.
I'm sure it's something simple in my formula that I'm doing wrong, but if
someone could help me out, that would be great!!
Thanks in advance!!