Fuel Mileage (MPG) (1 Viewer)

deadman

Registered User.
Local time
Yesterday, 18:00
Joined
Feb 13, 2002
Messages
23
Newbie question...Using Access 2000 in XP. I have searched here and in other forums and found this discussed, but never resolved. I am trying to run a report that will display the vehicle's mpg. Each time fuel is purchased, the user enters total $ amount, cost per unit, odometer reading, and checks a yes/no box to indicate wether or not this was a fillup, or just a partial fill of the fuel tank. I am trying to make the report where it figures the mpg at each fillup. Therefore, the report has to add any partial fills to the eventual fillup and subtract the odometer reading from the last fillup from the odometer reading of the current fillup, ignoring the odometer reading(s) from the partial fill(s). I have attached a reduced sample. Any help appreciated.
 

Attachments

  • PantherReduced.zip
    28.3 KB · Views: 326

lark_tilly

Registered User.
Local time
Yesterday, 18:00
Joined
Jun 22, 2007
Messages
67
The best way to do this will be with some code in the Detail_Format event of the report. From there you can store the values needed until the logic says its time to do the calc.
I'm not at a computer with Access at the moment. If no one helps you with this before I get back to one I'll write the code for you. It'll probably be late tomorrow before I'll be able to do it.
Is this going to be for a single vehicle or muliple?
 

deadman

Registered User.
Local time
Yesterday, 18:00
Joined
Feb 13, 2002
Messages
23
Is this going to be for a single vehicle or muliple?
Ultimately multiple vehicles. I did not include that trying to keep it simple. There is a table called "trucks" with autonumber key field "vehicleID" and several other descriptive fields and would be linked to table "tblAllExpenses" on vehicleID. Any help appreciated and thanks for the quick response. I don't have internet access everyday, so if I don't respond right away, that is why.
 

lark_tilly

Registered User.
Local time
Yesterday, 18:00
Joined
Jun 22, 2007
Messages
67
I'm working on this. As usual, I ran into a couple of other things that needed to be coded that we didn't discuss. I'll explain when I post the completed report for you to look at. Might have it Wed, probably Thursday.:)
 

deadman

Registered User.
Local time
Yesterday, 18:00
Joined
Feb 13, 2002
Messages
23
Thanks for any help you can give, lark tilly. There's no rush here. I'm self-employed, so there's no boss breathing down my neck or anything. I've been doing it all long hand for quite some time and this is going to be a major convenience and hopefully get things running more smoothly.
 

deadman

Registered User.
Local time
Yesterday, 18:00
Joined
Feb 13, 2002
Messages
23
Yes, it will be more accurate to view the results over a greater time period than one full tank to the next. I have all of my reports triggering from a form where I can enter date ranges, different vehicle id's etc. I figured if I can get help with the correct code or method to get the correct result, I would hope to be able to adjust the code myself to allow for a start date / end date, etc. Fuel expenses consume approximately 30 percent of my revenue, so I am very "in tune" with this figure and constantly striving to improve it. Btw, a full tank of fuel for me is just over 300 gallons and I buy fuel 2 to 3 times a week, sometimes more. The partial fills come in when I know that I can buy fuel cheaper several hundred miles up the road, I'll splash in 50 gallons or so just to get me to the cheap fuel. (Never thought I would call $2.85 a gallon cheap). Thanks for any help...
 

Users who are viewing this thread

Top Bottom