Private Sub ComboBox1_Change()
Me.ComboBox1.Value = Format(Me.ComboBox1.Value, "hh:mm")
Call SetTextBox5
End Sub
Private Sub ComboBox2_Change()
Me.ComboBox2.Value = Format(Me.ComboBox2.Value, "hh:mm")
Call SetTextBox5
End Sub
Private Sub SetTextBox5()
On Error Resume Next
If CDate(Me.ComboBox2.Value) > CDate(Me.ComboBox1.Value) Then
Me.TextBox5.Value = Round(24 * (CDate(Me.ComboBox2.Value) - CDate(Me.ComboBox1.Value)), 0)
Else
Me.TextBox5.Value = Round(24 + 24 * (CDate(Me.ComboBox2.Value) - CDate(Me.ComboBox1.Value)), 0)
End If
On Error GoTo 0
End Sub