Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    May 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Drill Down List Boxes (Access 2002)

    I am trying to develop a drill down search for data. For esthetic purposes, I prefer to use list boxes for the selection. I have attached a simplified application. I know that there are better ways to structure the data, but this is simple enough to figure out what I am doing wrong. Start with the Sport List Box Form. Select a sport and click the "Open Team List Box" control button. The list box opens with all teams shown not just those associated with the sport selected. As an experiment, I attached a second control button "Select Open Teams" when selected, this shows a filtered table with only teams from the selected sport. But, as I noted, I would prefer that the results be shown as a drop down box. Where am I going wrong? Thanks, Dale
    Attached Files Attached Files

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Drill Down List Boxes (Access 2002)

    You have got to provide a filter on the SELECT in the list box in the form [Team List Box].

    In the FormOpen event of the called form (Team List Box) I would build a SELECT for the called form's list box that is based upon the calling form's (Sport List Box) listbox.

    Pat

    Pat

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Drill Down List Boxes (Access 2002)

    You used the button wizard to create the code. It includes a variable stLinkCriteria for the WHERE condition, but you don't do anything to populate it. In the code behind the other button, you actually populate the stLinkCriteria variable before passing it to the form being opened, so that form uses the string to set its Where condition. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>.
    Charlotte

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Drill Down List Boxes (Access 2002)

    Not if you use the WhereCondition argument of DoCmd.OpenForm. In that case, the form being opened doesn't need any extra code to handle the filtering. That was being done from one button in the sample but not from the other.
    Charlotte

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Drill Down List Boxes (Access 2002)

    The called form is not bound to a table but contains a list box that DaleA wants populated based upon the calling forms list box. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

    Pat

  6. #6
    New Lounger
    Join Date
    May 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drill Down List Boxes (Access 2002)

    Charlotte:
    Thanks for the response and advice. It will take me a little time to digest the advice that you and Pat provided. I'm very impressed with this Forum. It is rich in content and is very professionally run. I appreciate the help.
    Dale

  7. #7
    New Lounger
    Join Date
    May 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drill Down List Boxes (Access 2002)

    Pat:
    Thanks for your quick response. It will take me some time to digest the advice that you and Charlotte provided. This is a great service and it is a pleasure to work with you.
    Dale

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Drill Down List Boxes (Access 2002)

    Hi Dale

    I have amended your DB to show what I think you want. It may not be what you want.
    I changed the Form [Sport List Box] to populate the OpenArgs argument of the OpenForm of form [Team List Box].
    Then in [Team List Box] in the FormOpen event I setup the RowSource of the list box to an SQL that I built on the fly, then the next thing to do was to ReQuery the list box.
    Attached Files Attached Files

Posting Permissions

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