Share via

Filter continuous form using combo box

Anonymous
2013-09-23T13:05:18+00:00

I have a continuous form that displays a list of contacts. I want my users to be able to use a combo box (cboArea)  to filter the results by first 3 digits of the zip code. I would like the user to select a city from the combo box, and the form to show results for all zip codes in that city. For example:

Chicago (show results for 123**, 124**, 125**)

Miami (show results for 223**, 323**)

Boston (show results for 333**)

Other (show all results that are not 123**, 124**, 125**, 223**, 323**, 333**)

I know how to do this if each option represented only one zip code, but I don't know how to add multiple zip codes or do the "Other" option. Does anyone know how to do this using code for the combo box, the form's Record Source, or anything else?

Thanks in advance for any help!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2013-09-27T09:04:18+00:00

    If it were me I would keep it really simple (less to go wrong).

    An idea would be to just base the form on a query and have an unbound combo to run a QBF.

    Like this

     (FilterConForm)

    http://sdrv.ms/19EwAuf

    Really simple but it works fine :-)

    Hope this helps

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2013-09-26T17:42:12+00:00

    My table does have separate fields for City and Zip code. But I'm not sure how to do 2 cascading combos.

    The "Other" option is for records that are not from one of our main contact areas. The "City" field is not null, but the "Zip" field does not match any of our main areas. This option is important because users will add contacts that are from unique zip codes and new areas, and I need an option that will display these areas that do not come up for any other filter.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-09-25T07:55:12+00:00

    Make sure your table has seperate Town/City and Post/Zip code fields.

    You can then use 2 casscading combos for this.

    This will work fine for the "Other" which I assume is areas without a town/City (the field is Null) as you just use "" (or Null)  in the 1st combo

    Was this answer helpful?

    0 comments No comments