Hi all,
First I want to say I've been surfing this forum for a year and you all have helped me far more than you could ever imagine.
I've looked quite a bit for an answer to this problem, but have yet to find it.
I have a text string [timedisp] that takes in an amount of time, i.e. :15 or 1:00 or 11:15, etc. The text string is not a fixed length, like hh:mm. What I am trying to do is simply take the number of hours and convert it into minutes and then add the minutes to that.
The following is what I have written:
Me.txttimereal = (Val(Left(Me.txttimedisp, InStr(1, Me.txttimedisp, ":"))) * 60 + Val(Right(Me.txttimedisp, InStr(1, Me.txttimedisp, ":") + 1)))
I currently get the correct answers if [timedisp] is 1:00 (60 minutes) and if it is :15 (15 minutes) but not when the string is 1:15 (it should be 75 minutes, but I get 60 minutes)
I think I'm on the right track, but maybe not.
Any solutions would be greatly appreciated.
Thanks,
John
First I want to say I've been surfing this forum for a year and you all have helped me far more than you could ever imagine.
I've looked quite a bit for an answer to this problem, but have yet to find it.
I have a text string [timedisp] that takes in an amount of time, i.e. :15 or 1:00 or 11:15, etc. The text string is not a fixed length, like hh:mm. What I am trying to do is simply take the number of hours and convert it into minutes and then add the minutes to that.
The following is what I have written:
Me.txttimereal = (Val(Left(Me.txttimedisp, InStr(1, Me.txttimedisp, ":"))) * 60 + Val(Right(Me.txttimedisp, InStr(1, Me.txttimedisp, ":") + 1)))
I currently get the correct answers if [timedisp] is 1:00 (60 minutes) and if it is :15 (15 minutes) but not when the string is 1:15 (it should be 75 minutes, but I get 60 minutes)
I think I'm on the right track, but maybe not.
Any solutions would be greatly appreciated.
Thanks,
John