Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Seattle, Washington, USA
    Posts
    179
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filtering a combo box (Access 2000 SP2)

    My previous thread sorta of died out a while back, but I got the answer I needed. However, I need some more assistance in finally completing my darn form...

    When I choose a cabin from a combo box, I want the Room combo box to limit its list to what I choose in the Cabin field. For example, I have 7 cabins, each have x number of rooms. Right now, if I choose Cabin A, I still see ALL rooms for ALL cabins in the Room combo box. I want it to show ONLY rooms that is related to Cabin A. I was thinking of using If...Then but I'm not sure where do I start?

    Thanks.

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

    Re: Filtering a combo box (Access 2000 SP2)

    In the AfterUpdate event of the Cabin combo box do a requery of the room combo box.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Filtering a combo box (Access 2000 SP2)

    Brent

    Set the rowsource proerty of the room combo to a query that includes combocabin as a criterion.
    then do what Pat suggested to make sure that each time combocabin is changed, comboroom is updated.
    Regards
    John



  4. #4
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Seattle, Washington, USA
    Posts
    179
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filtering a combo box (Access 2000 SP2)

    <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15> FINALLY LICKED it! Actually, it was a "mish-mash" of solutions from all involved.

    Credits:

    John H. - Thanks for the help on using query to pull all data together then using the Form Wizard to create the form. I decided to check out "linked tables" instead of using datasheets and it actually came even closer to what I needed and it set up VBA code that solved 75% of my problem (It set up filter).

    Tom - Thanks for the code! I borrowed one line from you (Redefining the Row Source property) and it worked wonders!

    Again, THANKS A MILLION to you both. <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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