Calculations on Continuous Forms

G

Glenn

I am trying to do two types of calculations of a Continuous Form. I have a
vehicle log form and I am trying to have a running calucation for mileage
used and one for total fuel put in vehicle. Mileage is input as odometer
reading at log entry. How do I program the difference between the first entry
and last entry for mileage. and how do a running sum for the total fuel put
in vehicle?

Any help will be appriciated.
 
A

Allan Murphy

Do you need to show the running sum on the form?

Personally I would do the following

Have the following fields

Odometer_start this is the reading at the start of the period, trip, day
etc.
Odometer_finish this the reading at the end of the period, trip, day etc.

mileage this will store the distance travelled

Using the odometer_finish afterupdate event enter the following code

me!mileage = me!odometer_finish - me!odometer_start

Fuel - this is the amount of fuel added

A report will give the running sum of mileage and fuel etc.

If you used a form and you made a mistake in a previous entry, all entries
after this entry would need to be recalculated.. By using a report to show
the running totals there is no need to recalculate if a form entry is
incorrect.

HTH

Allan Murphy
Email: (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top