Sum time from two fields and display as hh.mm

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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


Adnan said:
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
 
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!


Pieter Wijnen said:
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


Adnan said:
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

--------------------------------------------------------------------------------
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!
 
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


Adnan said:
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!


Pieter Wijnen said:
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


Adnan said:
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

--------------------------------------------------------------------------------
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!
 
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"
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


Adnan said:
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!


Pieter Wijnen said:
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!
 
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!


Pieter Wijnen said:
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"
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


Adnan said:
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!
 
…won’t recognize this \ 60 & Format(TT Mod 60, "\:00") (which is
something I must need)

Again, Thank you!
Adnan

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Pieter Wijnen said:
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"
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


Adnan said:
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!
 
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


Adnan said:
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!


Pieter Wijnen said:
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"
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!
 
Pieter,
These are the exact results I want – but I then get these results into
excel, when using formulas in excel I am having problems since the field is
formatted as text.
If there’s still another way of doing it formatted as number instead of text
would truly help!
Thank you very much!
Adnan

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Pieter Wijnen said:
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


Adnan said:
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!


Pieter Wijnen said:
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!
 
then you don't do the calc in Access, but apply the same technique to Excel
I belive the Format function works the same there, if not ask in an excel
group

Pieter

Adnan said:
Pieter,
These are the exact results I want - but I then get these results into
excel, when using formulas in excel I am having problems since the field
is
formatted as text.
If there's still another way of doing it formatted as number instead of
text
would truly help!
Thank you very much!
Adnan

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Pieter Wijnen said:
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


Adnan said:
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!
 
Thank you Pieter - I'll see what I can do with Excel group!
Appreciate your time and help!
Adnan

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Pieter Wijnen said:
then you don't do the calc in Access, but apply the same technique to Excel
I belive the Format function works the same there, if not ask in an excel
group

Pieter

Adnan said:
Pieter,
These are the exact results I want - but I then get these results into
excel, when using formulas in excel I am having problems since the field
is
formatted as text.
If there's still another way of doing it formatted as number instead of
text
would truly help!
Thank you very much!
Adnan

--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Pieter Wijnen said:
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!

--------------------------------------------------------------------------------
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!
 

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

Back
Top