Here's what I came up with in the end:
=================================================================
Public Function TicksToTime(ByVal theTicks As Double) As String
debugStackPush mModuleName & ": TicksToTime"
On Error GoTo TicksToTime_err
' PURPOSE: To convert a tick count (thousandths of a second) into
' a time string in the format "HH:NN:SS"
' ACCEPTS: Number of ticks
' RETURNS: Formatted time string
Dim myHours As Long
Dim myMinutes As Long
Dim mySeconds As Long
Dim strTime As String
Const secondsPerDay As Long = 86400
Const secondsPerHour As Long = 3600
Const secondsPerMinute As Long = 60
Const minutesPerHour As Long = 60
mySeconds = theTicks * 0.001
If mySeconds < secondsPerDay Then
strTime = Format$(mySeconds / secondsPerDay, "hh:nn:ss")
Else
myHours = mySeconds / secondsPerHour
myMinutes = mySeconds Mod secondsPerHour
mySeconds = myMinutes Mod secondsPerMinute
myMinutes = myMinutes / secondsPerMinute
strTime = Format$(myHours, "#,#00") & ":" & Format$(myMinutes,
"00") & ":" & Format$(mySeconds, "00")
End If
TicksToTime = strTime
TicksToTime_xit:
debugStackPop
On Error Resume Next
Exit Function
TicksToTime_err:
bugAlert True, ""
Resume TicksToTime_xit
End Function
=================================================================