K
Kou Vang
I have inserted a function into one of my forms. When I just insert it into
a module by itself it works, but not in my form. It is from the compare 2
times in the Microsoft KB. Does this function need to be in it's own module
in order to work? When I try to call it in my form, it says it doesn't
recognize the sub or function. Thanks!
Option Explicit
Function ElapsedTTime(Interval)
Dim x
x = Int(CSng(Interval * 24 * 3600)) & " Seconds"
Debug.Print x
x = Int(CSng(Interval * 24 * 60)) & ":" & Format(Interval, "ss") _
& " Minutes:Seconds"
Debug.Print x
x = Int(CSng(Interval * 24)) & ":" & Format(Interval, "nn:ss") _
& " Hours:Minutes:Seconds"
Debug.Print x
x = Int(CSng(Interval)) & " days " & Format(Interval, "hh") _
& " Hours " & Format(Interval, "nn") & " Minutes " & _
Format(Interval, "ss") & " Seconds"
Debug.Print x
End Function
a module by itself it works, but not in my form. It is from the compare 2
times in the Microsoft KB. Does this function need to be in it's own module
in order to work? When I try to call it in my form, it says it doesn't
recognize the sub or function. Thanks!
Option Explicit
Function ElapsedTTime(Interval)
Dim x
x = Int(CSng(Interval * 24 * 3600)) & " Seconds"
Debug.Print x
x = Int(CSng(Interval * 24 * 60)) & ":" & Format(Interval, "ss") _
& " Minutes:Seconds"
Debug.Print x
x = Int(CSng(Interval * 24)) & ":" & Format(Interval, "nn:ss") _
& " Hours:Minutes:Seconds"
Debug.Print x
x = Int(CSng(Interval)) & " days " & Format(Interval, "hh") _
& " Hours " & Format(Interval, "nn") & " Minutes " & _
Format(Interval, "ss") & " Seconds"
Debug.Print x
End Function