Lost my database, please help!

RichGags

Registered User.
Local time
Today, 04:00
Joined
Jun 30, 2003
Messages
39
I asked a week or so ago about calculating time differences and I got help, but I lost my database and I cannot remember how to do this.

I was pointed to a function to calculate the elapsed time between 2 hour fields. Here it is:


Public Function fElapsedTime(vStartTime As Variant, vEndTime As Variant) As String
Dim intHrs As Integer, intMins As Integer

If Not IsDate(vStartTime) Or Not IsDate(vEndTime) Then Exit Function

If vStartTime > vEndTime Then
intMins = DateDiff("n", DateAdd("d", -1, vStartTime), vEndTime)
Else
intMins = DateDiff("n", vStartTime, vEndTime)
End If

intHrs = intMins \ 60
intMins = intMins Mod 60

fElapsedTime = intHrs & ":" & Format(intMins, "00")

End Function


I cannot remember how to call this function. How do I get this field to update? Do I do it in the Control Source of an Unbound field on my form? or in the Visual Basic window under some event?

Thanks.
 
Last edited:
If you previously received an answer but cannot now find it use the little "search" button under your name. This will show you all of the threads that you have posted in.
 
Thanks.
 

Users who are viewing this thread

Back
Top Bottom