![]()
Hello All,
I am working on a stopwatch program to record times for various job's
and am having trouble setting the start and stop to count off the date & Time![]()
any info would be greatly appreciated![]()
So far I have txtDate & TxtTime set to systemtime
VB Code:
Private Sub Timer1_Timer() txtDate = Date txtTime = Time End Sub Private Sub Form_Load() Timer1.Enabled = True EmpClock.Enabled = True End Sub
and then I am usin cmdStart & cmd Stop
and txtStart , txtStop, & txtTotal wich will be of course txtstarttime + txtstoptime
the issue is setting start & stop off the txtTime
this is what ive got on this part so far
VB Code:
Dim hour As Single Dim min As Single Dim sec As Single Private Sub cmdStart_click() EmpClock.Interval = 1000 'Need Something to Help Start timer off current time txtTime and place into txtStart End Sub Private Sub cmdStop_Click() 'Need Something to Help Stop Timer and take current time & place into txtStop then I should be able to find the difference and place into txtTotal End Sub Private Sub EmpClock_Timer() If min = 60 Then hour = hour + 1: min = 0 If sec = 60 Then min = min + 1: sec = 0 txtStart.Text = Format(Str(hour), "00") & ":" & _ Format(Str(min), "00") & ":" & _ Format(Str(sec), "00") txtStop.Text = Format(Str(hour), "00") & ":" & _ Format(Str(min), "00") & ":" & _ Format(Str(sec), "00") txtTotal.Text = Format(Str(hour), "00") & ":" & _ Format(Str(min), "00") & ":" & _ Format(Str(sec), "00") End Sub Private Sub cmdReset_Click() txtStart.Text = "00.00.00" txtStop.Text = "00.00.00" txtTotal.Text = "00.00.00" hour = 0 min = 0 sec = 0 End Sub
thanks for any help on this![]()




Reply With Quote