# MS Access (2002) Query/Form Help needed

**URL:** <https://boards.straightdope.com/t/ms-access-2002-query-form-help-needed/218030>\
**Category:** Factual Questions\
**Created:** [December 9, 2003, 10:31pm UTC](https://boards.straightdope.com/t/ms-access-2002-query-form-help-needed/218030 "2003-12-09T22:31:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nightsong](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/nightsong/32/3083_2.png) [@Nightsong](https://boards.straightdope.com/u/Nightsong)\
**Post date:** [December 9, 2003, 10:31pm UTC](https://boards.straightdope.com/t/ms-access-2002-query-form-help-needed/218030/1 "2003-12-09T22:31:48Z")

</div>

I’m trying to get a form set up in Access that takes what’s been clicked on in two different drop-boxes, then brings up the corresponding record(s) from the database.

For example, if I have a drop-down box titled ‘Car type’ with ‘compact’ selected, and another drop-down box titled ‘color’ with ‘red’ selected, I want all records that match those to show up in my text area.

The problem is I don’t know how to get the form to do that and I’m not having much luck trying to understand the help file, or tracking down a website with an example for me to look at. (Once I’ve seen how to do it, I can take it from there.)

So, could anyone either tell me how to get this done, or point me at a website that shows how?

Thanks in advance! 🙂

* * *

\<\< Coffee. The 100% natural subsitute for sleep. \>\>

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [December 9, 2003, 11:11pm UTC](https://boards.straightdope.com/t/ms-access-2002-query-form-help-needed/218030/2 "2003-12-09T23:11:35Z")

</div>

OK, presumably you have the combo box working OK? - if not, you can use the wizard to get it to display a list of values from a table (usual practice is to get it to _display_ some textual value from a table, but _store_ the value in the corresponding key field for that row, but it is a little hard to explain how to set that up).

The best way to display a set of records is to make a Datasheet form, based on your query, then insert this datasheet form as a subform into the one that has the combo box.

Then edit the query and in the criteria row, use an expression like this:  
**like Forms![YourFormName]![YourComboName]**  
or  
**= Forms![YourFormName]![YourComboName]**  
(The former code being for the comparison of textual data, the latter numeric)

Then in the OnChange event of your combo box, insert the instruction:  
**Me.YourSubFromeName.Requery**

---

<div class="post-metadata">

**Author:** ![Nightsong](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/nightsong/32/3083_2.png) [@Nightsong](https://boards.straightdope.com/u/Nightsong)\
**Post date:** [December 9, 2003, 11:59pm UTC](https://boards.straightdope.com/t/ms-access-2002-query-form-help-needed/218030/3 "2003-12-09T23:59:09Z")

</div>

I got the boxes working right: they’re grabbing the possible values to choose from, from the existing tables.

Ahh, so that’s the syntax… I’ll have to poke around with the database tomorrow (I’ve since headed home from work) and see how it goes.

Thanks!

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [December 10, 2003, 12:26am UTC](https://boards.straightdope.com/t/ms-access-2002-query-form-help-needed/218030/4 "2003-12-10T00:26:16Z")

</div>

[Here](http://homepage.ntlworld.com/gurman/FilterCombo.zip) is a very quick and dirty example of how it can be done - it is in A97, but it may be possible to import this into A2002.

---

<div class="post-metadata">

**Author:** ![Nightsong](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/nightsong/32/3083_2.png) [@Nightsong](https://boards.straightdope.com/u/Nightsong)\
**Post date:** [December 10, 2003, 3:12pm UTC](https://boards.straightdope.com/t/ms-access-2002-query-form-help-needed/218030/5 "2003-12-10T15:12:12Z")

</div>

Oooo! Thank you ever so much Mangetout: having a nice example to fiddle around with a tweak makes it much easier to figure out.

_sends Mangetout some Christmas cookies and the like_
