# Thread: Totals In A Form Footer (Access 2002)

1. ## Totals In A Form Footer (Access 2002)

I created a text box that is located in a form footer; I'm trying to sum a text box that was created in the form detail and the control source is "=IIf([HrlyRateOVR] Like 0,[Hrs921]*[HrlyRate],[Hrs921]*[HrlyRateOVR])" the text box is called "AccrualAmtGrs"; text box in the footer has the control source "=Sum(Nz([AccrualAmtGrs]))". When I open the form the text box in the footer displays "0.00". However there are values in the form detail.

2. ## Re: Totals In A Form Footer (Access 2002)

Like 0 is not a valid expression, Like always compares to a string value, and that value should contain a wildcard character "*" or "?". What exactly are you trying to calculate?

Apart from that, you should use the expression in the sum, not the control:

=Sum(Nz(IIf([HrlyRateOVR] Like 0,[Hrs921]*[HrlyRate],[Hrs921]*[HrlyRateOVR])))

3. ## Re: Totals In A Form Footer (Access 2002)

I'm trying to perform a calculation based on the value of two fields; the default value of both fields are "0" zero; thus only one field can contain a number other than zero. Bottom Line; I just want to display a total on the form footer for all the detail records. However the control source is a calculated field in the form detail. Thanks for your help. Can you use "Is 0" ("Zero")?

4. ## Re: Totals In A Form Footer (Access 2002)

I don't understand "thus only one field can contain a number other than zero". Why can't both fields contain a number other than zero?

You can compare to zero simply by using = 0; I don't think the Nz does anything here.

=Sum(IIf([HrlyRateOVR] = 0,[Hrs921]*[HrlyRate],[Hrs921]*[HrlyRateOVR]))

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•