I have two now() values in text boxes (txtDate1 and txtDate2)
the first date is the registration date and the second is the start date. i want to calculate the response time (date2 - date1) and have the result in the format hh:mm:ss
Oh, the Now() threw me.
I created two textboxes. The control source for the first was
=DateDiff("n",[testDate1],[testDate2])
This changes the difference to minutes.
The control source of the second is
=[TotalMin]\60 & Format([TotalMin] Mod 60,"\:00")
This formats it the way you want.
So you can make the first textbox invisible.
I need glasses. I just reread your post and you want seconds.
So you can create an unbound textbox, then on the Oncurrent event of the form you can put:
Private Sub Form_Current()
Dim secinterval
Dim x
secinterval = Me![testdate2].Value - Me![testdate1].Value
x = Int(CSng(secinterval * 24)) & ":" & Format(secinterval, "nn:ss")
Me![Text9].Value = x
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.