Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo box choice creating filtered combo box (2002)

    I have attached a simple database in the hope of learning how to apply the principle to something more complicated. I want to create a combo box for the leagues (American, National, International) in the form. In the subform, I want a combo box that will only give me the teams that match the league and not every team. So, when I select American, I will get Blue Jays, Red Sox and Yankees and nothing else. Any idea of how to accomplish this simply?
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo box choice creating filtered combo box (2002)

    Why would you want to do that?

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box choice creating filtered combo box (2002)

    I guess so I can see what I am looking for and select it.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo box choice creating filtered combo box (2002)

    That doesn't make sense to me in your form/subform setup. You could use it in an unbound form to select a league and then a team within that league. I have added such a form in the attached version of your database (Access 2000 format, zipped). The combo box for the teams has qryTeam as row source; this query refers to the combo box for the leagues in the criteria for the LeagueID field. The team combo box is requeried in the After Update event of the league combo box:

    Private Sub cboLeague_AfterUpdate()
    Me.cboTeam = Null
    Me.cboTeam.Requery
    End Sub
    Attached Files Attached Files

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box choice creating filtered combo box (2002)

    OK, I have the filtered combo box working. I spent hours on it. Don't know what I finally did right (that's dangerous), but it works. Now, is it possible to have the second combo box connect to a subform, so that when I select the value, it shows all of the values pertaining to that selection. If the answer is no, I won't be unhappy. I have spent hours just getting this far.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo box choice creating filtered combo box (2002)

    Please explain in more detail what you want to accomplish.

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box choice creating filtered combo box (2002)

    I created the filtered combo boxes - when you select the value from one, it gives you only the choices from the linked table that relate to that value. I wanted to then create a subform that would like to the second combo box so that when I select the value there, the subform is populated only with the choices that releate to the value of the second combo box. I also want to be able to add records in this subform. I hope that explains it better.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo box choice creating filtered combo box (2002)

    Take a look at the database attached to <post:=132,267>post 132,267</post:> (Access 97 format, zipped). It shows how to filter a subform based on the selection in combo boxes.

Posting Permissions

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