filter one list box based on another

F

Flick Olmsford

I have a form (Access 2003) that has two list boxes. One list box, called
sales_orders shows sales orders with the first field called salesorderid.

If I select any order in this list box, I want a second list box, called
sales_order_details to show only the items in for the selected sales order.
This list box data will have the salesorderid for each detail record.

How do I do this? The list boxes are single row select only.

Thanks
 
W

Wayne-I-M

base both listboxes on queries (use the build option in the source row)

In the second query (that supplies the data for the 2nd list) place a
criteria row the points to the 1st list box bound colum on the form
 
F

Flick Olmsford

Thanks for the response. I did that but am having trouble with the property
I use to do that. I get nothing showing up in the second list box. I am
trying to use the query builder. Do I need to use VB code?
 
W

Wayne-I-M

No - no code is needed.

You need to have the bound field of the first list included in the query
that the 2nd list is based on.

So say you have
ID
1stName
Surname
Hair colour

and in the 2nd list you want all the people with brown hair
In the first list you you would have the bound column as the Hair colour
(you can display a different field by using the column widths control of the
list box)

In the query that the 2nd list is based on
In the hair colour column clik the biuld option
In the builder select forms and select the form
select the 1st list

This will filter the 2nd list based on the selection you make in th 1st

Hope all this is clear - sorry if my english is not to good to explain better
 

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