• Filtering a combo box (Access 2000 SP2)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Filtering a combo box (Access 2000 SP2)

    Author
    Topic
    #376294

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #615692

      In the AfterUpdate event of the Cabin combo box do a requery of the room combo box.
      Pat cheers

    • #615705

      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.

      • #616069

        thumbup 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. cheers

    Viewing 1 reply thread
    Reply To: Filtering a combo box (Access 2000 SP2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: