Rainbowhawk
Registered User.
- Local time
- Today, 03:40
- Joined
- Oct 8, 2007
- Messages
- 54
Hi All
I have an issue with this piece of code
This code converts fuel in litres and Kilometres covered in to MPG
However when it writes the answer to the field it is populating the answer is being rounded, field is set as fixed to 2 decimal places.
I am using Access 97 (yep still in the dark ages)
All help appreciated
I have an issue with this piece of code
This code converts fuel in litres and Kilometres covered in to MPG
However when it writes the answer to the field it is populating the answer is being rounded, field is set as fixed to 2 decimal places.
I am using Access 97 (yep still in the dark ages)
Code:
[COLOR=black][FONT=Verdana]Dim g As Double[/FONT][/COLOR]
[FONT=Verdana][COLOR=black]Dim m As Double[/COLOR][/FONT]
[FONT=Verdana][COLOR=black]Dim mp As Double[/COLOR][/FONT]
[COLOR=black][FONT=Verdana]g = Me.Fuel / 4.54609188[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]m = Me.TotalKms * 0.621371192[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]mp = m / g[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]MsgBox mp 'shows answer on screen with loads of decimal places[/FONT][/COLOR]
[FONT=Verdana][COLOR=black]Me.MPG = mp 'is giving a rounded answer[/COLOR][/FONT]
All help appreciated