BadgerLikeSpeed
Registered User.
- Local time
- Today, 16:54
- Joined
- Feb 7, 2013
- Messages
- 35
I hope there is a very simple answer to this (as with all the questions I have!)...
So here is my code:
What I want is to get the sum of the fuel used in teh AllFuelBox textbox. Currently I get 'False'... If I write =FuelCal + FuelHav etc in the data field it writes the numbers one after another. As in not a sum, just the 1st value, then 2nd and so on.
Have I somehow changed the figures from numbers to text? I'm a novice at this vba thing (as I may have mentioned before!), so any help would be appreciated. I've tried googling, but nothing seemed to be of use.
Thanks
So here is my code:
Code:
Dim FuelCal As String
Dim FuelGel As String
Dim FuelHav As String
Dim FuelKil As String
Dim FuelLin As String
Dim FuelMus As String
Dim FuelRam As String
Dim FuelWar As String
Dim FuelWtn As String
Dim FuelWat As String
Dim FuelAll As String
FuelCal = DSum("[GOUsed]", "EngUseCal")
FuelGel = DSum("[GOUsed]", "EngUseGel")
FuelHav = DSum("[GOUsed]", "EngUseHav")
FuelKil = DSum("[GOUsed]", "EngUseKil")
FuelLin = DSum("[GOUsed]", "EngUseLin")
FuelMus = DSum("[GOUsed]", "EngUseMus")
FuelRam = DSum("[GOUsed]", "EngUseRam")
'FuelWar = DSum("[GOUsed]", "EngUseWarr")
FuelWtn = DSum("[GOUsed]", "EngUseWtn")
FuelWat = DSum("[GOUsed]", "EngUseWat")
FuelAll = DSum("[GOUsed]", "EngUseCal") + DSum("[GOUsed]", "EngUseGel") + DSum("[GOUsed]", "EngUseHav") _
+ DSum("[GOUsed]", "EngUseKilroom") + FuelLin = DSum("[GOUsed]", "EngUseLin") + DSum("[GOUsed]", "EngUseMus") _
+ DSum("[GOUsed]", "EngUseRam") + DSum("[GOUsed]", "EngUseWtn") + DSum("[GOUsed]", "EngUseWat")
'Fill Report
Me.JobsSHookBox = JobSHook
Me.OilJobBox = JobOil
Me.DragonJobBox = JobDragon
Me.OtherJobBox = JobOther
Me.AllFuelBox = FuelAll
Me.FuelCalBox = FuelCal
Me.FuelHavBox = FuelHav
Me.FuelRamBox = FuelRam
Me.FuelKilBox = FuelKil
Me.FuelLinBox = FuelLin
Me.FuelWtnBox = FuelWtn
Me.FuelMusBox = FuelMus
Me.FuelGelBox = FuelGel
Me.FuelWatBox = FuelWat
'Me.FuelWarBox = 0
Have I somehow changed the figures from numbers to text? I'm a novice at this vba thing (as I may have mentioned before!), so any help would be appreciated. I've tried googling, but nothing seemed to be of use.
Thanks