The Total must be a text control not bound to a numeric Field to work.
It's just a way of Displaying TimeWorked + TimeTravel in hh:mm format.
No need to save the calculated value, as you can use the same calc in a
Query,Form or Report whenever you need it
HTH
Pieter
Hi Pieter --- this is what I get:
http://punaime.itgo.com/msaccess3.html
Appreciate ur help!
Adnan
--
Please post all your inquiries on this community so we can all
benefit -
Thank you!
:
The total code would be: Change names From Number1 & Number2 To
TimeWorked &
TimeTravel
Private Sub TimeWorked_AfterUpdate()
Dim TT As Double
TT = Nz(Me.TimeWorked.Value,0) ' If Blank (Null) - Convert to Zero
TT = TT + Nz(Me.TimeTravel.Value,0)
Me.Total.Value = TT \60 & Format(TT Mod 60, "\:00")
End Sub
Private Sub TimeTravel_AfterUpdate()
TimeWorked_AfterUpdate ' Same Calc
End Sub
Pieter
"Pieter Wijnen"
<it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.please@online.replace.with.norway>
wrote in message You have to return the value somewhere
ie
Private Sub Number1_AfterUpdate()
Me.Number1.Value=Me.Number1.Value \ 60 & Format(Me.Number1.Value
Mod
60,
"\:00")
End If
You Should use sensible names for your controls
ie Change Number1 to TimeWorked
HTH
Pieter
Pieter --- this is formula, I need to translate it to VBA code this
formnula
so I can execute via VBA cmdButtons.
Plz take a look at this sample then you'll know what I mean:
http://punaime.itgo.com/msaccess2.html
Truly appreciate your efforts and help!
Adnan
--
Please post all your inquiries on this community so we can all
benefit -
Thank you!
:
simply
Press Alt+Enter to bring up the properties sheet
locate the After Update Event (Event Tab - Surprise, surprise)
Type [ (will auto expand to [Event Procedure])
click the builder icon (...)
Paste & Ammend the code
.... you're the hero of the day
Pieter
Hi everyone!
How do I run this firmula on after update of a label or
cmdButton
on a
form:
=[TimeWorked] \ 60 & Format([TimeWorked] Mod 60, "\:00")
I have tree fieldes:
TimeWorked (formatted as gen. number --- 2 dec. places)
TimeTraveled (formatted as gen. number --- 2 dec. places)
Total (formatted as gen. numb. --- 2 dec. places)
.got this formula from Allen Browne
http://allenbrowne.com/casu-13.html
Thank you,
Adnan
--
Please post all your inquiries on this community so we can all
benefit -
Thank you!
--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4388 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4388 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4388 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4388 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!