Douglas J. Steele said:
Since what you're getting from the function is text, that IS "proper order",
but I understand what you're looking for... <g>
If you're strictly dealing with seconds, you could use the Val function on
what the function returns, and sort on it. That won't work, though, if
you're getting, say, minutes and second: you'll get
1 minute, 59 seconds
1 second
12 seconds
2 seconds
If you're strictly dealing with times (hhh:nn:ss), you could change what the
function returns so that it returns something like the format I just
indicated. You could change:
If booCalcHours And (lngDiffHours > 0 Or ShowZero) Then
If booCalcHours Then
varTemp = varTemp & IIf(IsNull(varTemp), Null, " ") & _
lngDiffHours & IIf(lngDiffHours <> 1, " hours", " hour")
End If
End If
If booCalcMinutes And (lngDiffMinutes > 0 Or ShowZero) Then
If booCalcMinutes Then
varTemp = varTemp & IIf(IsNull(varTemp), Null, " ") & _
lngDiffMinutes & IIf(lngDiffMinutes <> 1, " minutes", "
minute")
End If
End If
If booCalcSeconds And (lngDiffSeconds > 0 Or ShowZero) Then
If booCalcSeconds Then
varTemp = varTemp & IIf(IsNull(varTemp), Null, " ") & _
lngDiffSeconds & IIf(lngDiffSeconds <> 1, " seconds", "
second")
End If
End If
to
If booCalcHours And (lngDiffHours > 0 Or ShowZero) Then
If booCalcHours Then
varTemp = Format(lngDiffHours, "000")
End If
End If
If booCalcMinutes And (lngDiffMinutes > 0 Or ShowZero) Then
If booCalcMinutes Then
varTemp = varTemp & ":" & _
Format(lngDiffMinutes, "00")
End If
End If
If booCalcSeconds And (lngDiffSeconds > 0 Or ShowZero) Then
If booCalcSeconds Then
varTemp = varTemp & ":" & _
Format(lngDiffSeconds, "00)
End If
End If