Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have 2 timers T3 starts a routine 1

Status
Not open for further replies.

007MCSE

IS-IT--Management
Jan 3, 2003
51
US
I have 2 timers T3 starts a routine and T4 stops a routine.

I also have an elapsed time (T5) textbox.

How can I get the elapsed time to display in time format starting at 00:00:00 when T3 starts and then stop when T4 stops.

I've tried numerous routines. but every time elapsed time starts it starts at 12:00:00.

I need T5 to show the exact elapsed time starting from 00:00:00

Any help would be appreciated.
 
I got this to work with very limited testing. I don't know what will happen if you pass midnight. You'll have to put it where you need it.

Dim elapsed As String

elapsed = "00:00:00"
Text3 = Format(DateAdd("s", DateDiff("s", CDate(Text1), CDate(Text2)), CDate(elapsed)), "hh:mm:ss")

Hope this helps.
 
Code:
Text1 = Now: Text2 = DateAdd("s", 127, Text1)
Text3 = format(CDate(DateDiff("s", CDate(Text2), CDate(Text1))/86400), "hh:mm:ss")

? Text3
00:02:07

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Thank you both for your help.
Neither of the solutions do what I want it to do.

Both solutions just show the diference between the start Time and Stop Time.

What I need it to do is count up in hours, minutes and seconds starting at 00:00:00 once the start routine is initiated.
 
just call it at what ever interval you want the value to update. In VB, nothing happens with out a "EVENT". In your case YOU need to supply the event - via the timer!

READ the HELP re events and timers!

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Hi Michael

My appologies. I forgot the event.
It works now

Thanks for your help
Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top