J
jasonsweeney
I have a user form that does the following:
(1) A textbox records the time when the userform opens (and the
employee's use of the form begins); and
(2) a different textbox records the time when the employee presses a
commandbutton signifying the conclusion of the data entry.
(3) In a third text box, I am trying to subtract time #2 from time #1
to calculate the total time spent by the employee on the particular
data entry item.
The code for entry of time in either textbox is simply:
___________
sub startime()
starttime = time
Userform1.textbox1.value = starttime
end sub
____________
sub endtime()
endtime = time
userform1.textbox2.value = endtime
' the following code doesn't work
userform1.textbox3.value = userform1.textbox2.value -
Userform1.textbox1.value
end sub
___________
Ideas? Bonus questions:
(A) I also want the textboxes to format the time as military time
00:00:00.
(B) It would be great if the start-time text box actually looked like a
timer and counter the minutes and seconds in real time
(1) A textbox records the time when the userform opens (and the
employee's use of the form begins); and
(2) a different textbox records the time when the employee presses a
commandbutton signifying the conclusion of the data entry.
(3) In a third text box, I am trying to subtract time #2 from time #1
to calculate the total time spent by the employee on the particular
data entry item.
The code for entry of time in either textbox is simply:
___________
sub startime()
starttime = time
Userform1.textbox1.value = starttime
end sub
____________
sub endtime()
endtime = time
userform1.textbox2.value = endtime
' the following code doesn't work
userform1.textbox3.value = userform1.textbox2.value -
Userform1.textbox1.value
end sub
___________
Ideas? Bonus questions:
(A) I also want the textboxes to format the time as military time
00:00:00.
(B) It would be great if the start-time text box actually looked like a
timer and counter the minutes and seconds in real time