Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2012
    Posts
    8

    Unanswered: Second Combo Box not updating

    Hello,
    First post so I apologize if I post something confusing.
    I did a search but was confused as to if I could only do what I need in VBA editor or using GUI.

    I have two combo boxes (1) scombo (2) rcombo. rcombo is limited by the selection in scombo using
    Code:
    SELECT Reason_code_t.Reason_code, Reason_code_t.Services
    FROM Reason_code_t
    WHERE (((Reason_code_t.Services)=[Forms]![Form1]![scombo]))
    ORDER BY Reason_code_t.Reason_code;
    The problem is that on the form itself if I choose one selection in scombo, the drop down in rcombo is correct but if I choose a second option in scombo(like I made a mistake) rcombo does not update.

    I did choose After update - Event procedure on scombo in the GUI which gives me VBA code of
    Code:
    Option Compare Database
    
    Private Sub rcombo_Click()
    
    End Sub
    
    Private Sub scombo_AfterUpdate()
    
    End Sub
    
    Private Sub scombo_Click()
    
    End Sub
    but I am unsure if there is something that I must change to make this work.

    Any help appreciated.

    Thank you.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    In the after update event of the first combo:

    Me.rcombo.Requery
    Paul

  3. #3
    Join Date
    Mar 2012
    Posts
    8
    Thank you for the advice, I am still unable to get it to work though, now it looks like
    Code:
    Option Compare Database
    
    Private Sub rcombo_Click()
    
    End Sub
    
    Private Sub scombo_AfterUpdate()
    
    End Sub
    
    Private Sub scombo_Click()
    
    End Sub
    
    
    Me.rcombo.Requery
    
    End Sub
    for scombo. I have also tried
    Code:
    Option Compare Database
    
    Private Sub rcombo_Click()
    
    End Sub
    
    Private Sub scombo_AfterUpdate()
    
    End Sub
    
    Private Sub scombo_Click()
    
    End Sub
    
    
    Private Sub Me.rcombo.Requery
    
    End Sub

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The only thing you should see:

    Code:
    Private Sub scombo_AfterUpdate()
      Me.rcombo.Requery
    End Sub
    Paul

  5. #5
    Join Date
    Mar 2012
    Posts
    8
    My apologies, I misunderstood you and it works =)

    Code:
    Option Compare Database
    
    Private Sub rcombo_Click()
    
    End Sub
    
    Private Sub scombo_AfterUpdate()
    Me.rcombo.Requery
    
    End Sub
    
    Private Sub scombo_Click()
    
    End Sub
    Thank you !

  6. #6
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Happy to help!
    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •