Controls not updating (screenshot)

xcmav66

Registered User.
Local time
Today, 02:36
Joined
Oct 29, 2008
Messages
29
I'm having a problem with the Available Furnaces and Current Runs controls. They are populated with queries that take criteria from the control above. So the Available Furnaces is populated with data from a query based on the selection in Furnace Runs, and the Current Runs is populated with data from a query based on the selection in Available Furnaces. For some reason, they are not updating. If I re-open the form, they will update as I want them to. I have tried various requery combinations but I can't seem to figure out why Available Furnaces and Current Runs aren't updating when I choose a different selection in the prior control.

Scheduler2.jpg
 
Last edited:
Sorry, but a screenshot is virtually useless to anyone trying to troubleshoot this for you! We really need to be able to view your code in order to figure out exactly how you're doing this and advise you how to modify your code to get it working.
 
Here's my code, and I updated the screenshot above so you can see the queries I'm using. Thanks again. (I know the code shown is excessive but I don't know if its relevant to the issue.)

Code:
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
 

Users who are viewing this thread

Back
Top Bottom