'Adrian Dunstan '15/2/2005 ' 'Assume that ttime is seconds 'Change to minutes or hours by using the converter functions below 'Time Constants Const TIME_SEC = 60 Public Function GetSongTime(ttime As Long) As String Dim lngTime As Long Dim strTime As String On Error GoTo SongTimeError lngTime = SecondsToMinutes(ttime) strTime = Str(lngTime) & ":" lngTime = ttime - (SecondsToMinutes(ttime) * TIME_SEC) If Len(Trim(Str(lngTime))) = 1 And lngTime = 0 Then strTime = strTime & Trim(Str(lngTime)) & "0" Else If lngTime < 10 Then strTime = strTime & "0" & Trim(Str(lngTime)) Else strTime = strTime & Trim(Str(lngTime)) End If End If GetSongTime = strTime Exit Function SongTimeError: MsgBox Err.Number & chr(13) & _ chr(10) & Err.Description Exit Function End Function Public Function SecondsToMinutes(sec As Long) As Long SecondsToMinutes = sec \ TIME_SEC End Function 'You can also use these functions here for larger times Public Function MinutesToSeconds(min As Long) As Long MinutesToSeconds = min * TIME_SEC End Function Public Function MinutesToHours(min As Long) As Long MinutesToHours = min \ TIME_SEC End Function Public Function HoursToMinutes(hour As Long) As Long HoursToMinutes = hour * TIME_SEC End Function