Time calculations

S

Salva

Hi

hi have this program in visual

Function CalcTime(Interval)
Dim objStartTime
Dim objEndTime
Dim objElapsedTime

'Get a reference to each field
Set objStartTime =
XDocument.DOM.selectSingleNode("//my:myFields/my:txtStartTime")
Set objEndTime =
XDocument.DOM.selectSingleNode("//my:myFields/my:txtEndTime")
Set objElapsedTime =
XDocument.DOM.selectSingleNode("//my:myFields/my:txtElapsedTime")

Dim totalhours, totalminutes
Dim hours, Minutes

totalhours = Int(CSng(Interval * 24))
totalminutes = Int(CSng(Interval * 1440))
hours = totalhours Mod 24
Minutes = totalminutes Mod 60
If Len(minutes) = 1 Then Minutes = "0" & Minutes

CalcTime = hours & ":" & Minutes
objElapsedTime.text = CalcTime
End Function

and Infopath return one error in the line " totalhours = Int(CSng(Interval *
24))" and the next line

is this normal?

Salva
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top