D
davjoh123
Search many posts but not finding the right answer. A lot of posts
suggest the datediff function or subtracting the start time from the
end time and multiply by 24 and 60. This does nothing for the
situation were the time changes from pm to am.
Is there a good answer?
'If IsNull(Me.Duration) Then
If Not IsNull(Me.SetEndTime) And Not IsNull(Me.SetStartTime)
Then
'Hour(Me.SetEndTime - Me.SetStartTime) * 60 +
' Me.Duration = (DateDiff("n", Me.SetStartTime,
Me.SetEndTime))
'stTime = CDbl(Me.SetStartTime)
'endTime = CDbl(Me.SetEndTime)
'dblDuration = Round((endTime - stTime) * 24 * 60, 0)
Me.Duration = Round((Me.SetEndTime - Me.SetStartTime) * 24
* 60, 0)
End If
'End If
suggest the datediff function or subtracting the start time from the
end time and multiply by 24 and 60. This does nothing for the
situation were the time changes from pm to am.
Is there a good answer?
'If IsNull(Me.Duration) Then
If Not IsNull(Me.SetEndTime) And Not IsNull(Me.SetStartTime)
Then
'Hour(Me.SetEndTime - Me.SetStartTime) * 60 +
' Me.Duration = (DateDiff("n", Me.SetStartTime,
Me.SetEndTime))
'stTime = CDbl(Me.SetStartTime)
'endTime = CDbl(Me.SetEndTime)
'dblDuration = Round((endTime - stTime) * 24 * 60, 0)
Me.Duration = Round((Me.SetEndTime - Me.SetStartTime) * 24
* 60, 0)
End If
'End If