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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a running sum on a form

Status
Not open for further replies.

AndieV

Technical User
Sep 2, 2001
10
0
0
CA
I am working on a database and need to create a running sum on a form. The database tracks mileage in both kms and miles and I need to be able to track the totals entered:
1)that day
2)by company
3)by unit number
and for each miles or kms

I know I could use a parameter query and enter the information, but I'd like to know is there is a way of bypassing this to show a total for current day, current company and current unit.

(and I'd like to run an autokey macro to display the totals, ie.F2 for miles, F3 for kms if possible so they do not appear on the actual form)

Hope someone can help

Andrea
 
It's not a true running total, but you could display the total mileage for the day by setting the control source of a text box to the following:

=DSum("[Miles]","TableName","[DateMiles]=#" & [txtDate] & "#")

You can set additional criteria at the end if it needs to match the company and/or unit number.

To display miles or kilometres, have your autokey macro change the control source to show the relevant field (assuming you have a different field for miles and km).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top