Option Compare Database
Private Sub Form_AfterUpdate()
CurrentRunsList.Requery
End Sub
Private Sub Form_Current()
RefreshTimeCombos
AvailableAbarsCombo.Requery
End Sub
Private Sub HourCombo_Change()
If Not (IsNull(HourCombo.Value) Or IsNull(MinuteCombo.Value) Or IsNull(TODCombo.Value)) Then
StartTimeText.Value = CStr(HourCombo.Value) + ":" + CStr(MinuteCombo.Value) + " " + CStr(TODCombo.Value)
End If
End Sub
Private Sub MinuteCombo_Change()
If Not (IsNull(HourCombo.Value) Or IsNull(MinuteCombo.Value) Or IsNull(TODCombo.Value)) Then
StartTimeText.Value = CStr(HourCombo.Value) + ":" + CStr(MinuteCombo.Value) + " " + CStr(TODCombo.Value)
End If
End Sub
Private Sub TODCombo_Change()
If Not (IsNull(HourCombo.Value) Or IsNull(MinuteCombo.Value) Or IsNull(TODCombo.Value)) Then
StartTimeText.Value = CStr(HourCombo.Value) + ":" + CStr(MinuteCombo.Value) + " " + CStr(TODCombo.Value)
End If
End Sub
Private Sub NewRecordButton_Click()
DoCmd.RunCommand acCmdRecordsGoToNew
RefreshTimeCombos
End Sub
Private Sub StartDateCombo_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If StartDateCalendar.Visible = False Then
StartDateCalendar.Visible = True
StartDateCalendar.SetFocus
If Not IsNull(StartDateCombo) Then
StartDateCalendar.Value = StartDateCombo.Value
Else
StartDateCalendar.Value = Date
End If
Else
StartDateCalendar.Visible = False
End If
End Sub
Private Sub StartDateCalendar_Click()
StartDateCombo.Value = StartDateCalendar.Value
StartDateCombo.SetFocus
StartDateCalendar.Visible = False
End Sub
Private Function RefreshTimeCombos()
If IsNull(StartTimeText.Value) Then
HourCombo.Value = Null
MinuteCombo.Value = Null
TODCombo.Value = Null
Else
If Format(CDate(StartTimeText.Value), "h") > 12 Then
HourCombo.Value = Format(CDate(StartTimeText.Value), "h") - 12
Else
HourCombo.Value = Format(CDate(StartTimeText.Value), "h")
End If
MinuteCombo.Value = Format(CDate(StartTimeText.Value), "nn")
TODCombo.Value = Format(CDate(StartTimeText.Value), "AMPM")
End If
End Function