Returning Seconds as a formatted Hour/Minute/Seconds String

Moonshine

Registered User.
Local time
Today, 10:26
Joined
Jan 29, 2003
Messages
125
Hi All

I have a little form, that is used for recording time spent on a task, mainly receiving a phonecall. It has other information on it, but for this task we are just working from the start time and end time of a "call"

So, i have fields and they have the time in. When the record i want the completion message box to show the total time, using this piece of code:
Code:
intCallDuration = DateDiff("s", Me.txtCallStart, Me.txtCallEnd)
That assigns the total, in seconds to a variable which i use in this:
Code:
MsgBox "Record Added" & vbCrLf & "Call Duration (Seconds): " & intCallDuration, , strTitle
Works OK, however if its a long call and you say get 4370 seconds, its just numbers so id like it to show a formatted string like below, depending on the time spent:

Record Added, Call Duration: 4minutes 37seconds.
Record Added, Call Duration: 1hr, 32minutes, 32seconds.

Is this possible?
 
It is definetly possble you will have to create a custome VBA function to make the string
 
Never have much luck at functions, i'll have a google and see what i can find. Thanks :)
 

Users who are viewing this thread

Back
Top Bottom