Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Total in a Form 1

Status
Not open for further replies.

Amfine

MIS
Joined
Feb 4, 2004
Messages
14
Location
US
I have a form with 8 entries and would like to show a total of all 8 entries in each record.
example:
Wst FacChrg twash Wgt Stfee Trans Secr Load Total
500 100 50 36 50 100 75 50 ????
400 100 45 25 75 200 60 45 ????

Any help would be greatly appreciated.

Thanks
Tim H
 
Tim

Several ways - here is one...
If referencing the form, create an unbound text field on the form. Then use a formula...
[tt]
= [Wst] + [FacChrg] + [twash] + [Wgt] + [Stfee] + [Trans] + [Secr] + [Load]
[/tt]

To accommodate missing data, use the Nz function...
[tt]
= Nz([Wst], 0) + Nz([FacChrg], 0) + Nz([twash], 0) + Nz([Wgt], 0) + Nz([Stfee], 0) + Nz([Trans], 0) + Nz([Secr], 0) + Nz([Load], 0)
[/tt]

Richard
 
I tried using the Nz function:

=Nz([Waste],0)+Nz([Facility Charge],0)+Nz([Tank Wash],0)+Nz([H2O/BTU/Solids/Weight Surcharge],0)+Nz([Loading Demurrage&Equipment],0)

I am getting #Name?

Any idea what I am doing wrong.

Thanks,
Tim
 
Tim

You probably have names a control incorrectly. Each variable, although not case sensitive, has to match exactly with the corresponding spelling - including spaces.

(...Which is one reason why spaces and special characters in field names is usually avoided.)

I used names provided in your original post.

Encapsulating field names with [field name] gets around this problem.

[Waste] - good

[Facility Charge] - a space, a more typical approach FacilityCharge, or Facility_Charge

[H2O/BTU/Solids/Weight Surcharge] - "/" is used for division and system directory locations - encapsulating the name with [...] should get around this issue.

[Loading Demurrage&Equipment] - "&" is used for joining variables or fields together - "Hello " & "World" -> "Hello World".

Check your spelling.
If you have time, and can re-do your reports and forms, consider renaming your fields without spaces and special characters.

Richard
 
Thanks for your help? I had 1 small typo.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top