list boxes

L

Lauren B

I am attempting to build a query that returns customers based on two
criteria: (1) state of residence and (2) type of product. All customers
only have one state of residence but can have multiple types of products.

It is important to note that: When entering a customer, the state is
selected by choosing the appropriate abbreviation in a combo box on the
"Customer_Information" form. This combo box subsequently fills the field
C_STATE with the abbreviation. The product types are then selected by a
clicking the appropriate check box. Each check box is tied to it's own
field. So, if a customer manufactures products 1 and 5, field P_1 and P_5
are populated with a "-1."

For my query, I want the user to be able to select multiple states and
multiple product types. For example, to conduct a query that returns all
customers in PA and NY that manufacture products 1 and 5.

I'm having a problem when it comes to setting up the query and linking it to
a form. I ideally want to have a list box of all state abbreviations and a
series of checkboxes each corresponding to product types. The user can then
highlight the states desired in the list box and check the appropriate
product types.

I've been referred to two websites
(http://www.mvps.org/access/forms/frm0007.htm and
http://www.microsoft-accesssolutions.co.uk/query_using_listbox.htm) they
were both helpful; however, they do not answer my question as to how I can
create a query with inputs from a form that have various components.

What is the best way to accomplish this task?

Thank you very much for your help. Any assistance is greatly appreciated.

LB
 
G

Guest

Lauren,

The best way to do this is to create a form, and then build a query using
this form's inputs. Someone else might now how to choose more than 1 item in
a list box, but what I've had to do is just add 2 or 3 combo boxes that pull
information off the same table. If you want check boxes, add those to the
form too. Then when you make your query, all your doing is referencing the
form in the criteria box.
Let's say you want the query to look for all of California items. Instead
of entering

Like "CA"

in the criteria field, you'll enter:

[Forms]![Name of your Form]![whatever you name the combo box]

This will then look up the items that people have chosen.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top