Results 1 to 4 of 4
  1. #1
    PicoTTS is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2016
    Posts
    29

    Filter Combobox Based on 2 Tables

    Hi everyone,



    I am looking for a bit of help on how to filter the values shown in a combobox.

    The way I have it setup now is I have 2 tables. 1 with all orders preloaded called "Orders" and another with all product sizes called "Sizes". The "Orders" table consists a list of all the orders including the "order#" and the corresponding sizes.

    I would like for my combo to list all the possible sizes from the "Sizes" table. On the form, I will have a couple of other fields that are on the "Orders" table. Once the user fills in a few of the fields, then the size combobox will filter the possible sizes that correspond to those criteria. If none match, then keep listing all the possible sizes.

    I hope I have explained this properly.

    Thanks

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    in general: a combobox is based upon a query. You find it in its control source property - or it can be based upon a query found in the navigation pane.

    any query in turn can have criteria which defines what records are in the set; and this criteria can be from a form's text box i.e. Forms!FormName.TextBoxName

    So all that is very standard and just takes a little practice to set up. The unusual issue you mention however is that if the criteria is blank - then you want to display all sizes; this is trickier than it sounds as then you will have to get into wild cards or something.....

  3. #3
    PicoTTS is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2016
    Posts
    29
    Sorry I misspoke. I meant that my "Orders" table is actually a query that filters from a "Orders" table based on my forms fields.

    I would like my users to have the option to either select a preloaded order while also being able to use dropdowns the create a brand new order is one hasn't been preloaded.

  4. #4
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    In general terms - the typical 'Orders' form; where one can look up an existing order, or enter a new order: is a form that in the header has a combobox for the lookup - - in design view when you drag the combobox into the header the wizard will pop up to walk you thru that set up. Then for the new order one drags on a command button into the header - - the wizard will pop up to walk you thru the set up to go to a new record.

    So you use the Combobox for the look up of an existing order and the button to begin a new order. Because one may need to look up an existing order a couple of different ways i.e. by Name, by Date, by PO#, etc. It is not unusual to have more than one Combobox in the header. This is the classic set up of a typical Orders form.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 11-05-2013, 10:09 PM
  2. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  3. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums