Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Filter listbox using combo box

81 views
Skip to first unread message

@discussions.microsoft.com Zoe

unread,
Nov 8, 2007, 5:52:02 PM11/8/07
to
I have a listbox on a form. The listbox row source is a query. It pulls in
fields such as Work Request ID, Category, Status, Assigned To etc.

On the same form I have an option group with 6 options (Category, Status,
Building, Floor etc). When one of these are selected - it populates a combo
box with the data. For example - if the user selects OptionCategory then the
combo box lists all the Categories to choose from.

Once the user has selected one of the six options and then selects an item
in the combo box - I want to filter the listbox to show only those records.
For example, the user chooses the Option Category and then selects the
category Plumbing from the combobox (cmbFilterBy). The listbox is then
filtered to show only those records where the category is Plumbing.

I know how to filter a report as the next step but I am looking to filter
the listbox and I am not sure how to go about doing this.

Thanks.

Al Campagna

unread,
Nov 10, 2007, 9:44:33 AM11/10/07
to
Zoe,
Let's say you have a combo (cboCategory) that allows the user selects a
Category, and that you select "Plumbing" from that combo, and... you've done
a Requery of your listbox on the AfterUpdate event of the combo.

In the query (RowSource) behind your listbox, the Category field should
have a criteria of...
=Forms!frmYourFormName!cboCategory
The listbox will only deliver those records where the Category =
"Plumbing"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Zoe" <Zoe @discussions.microsoft.com> wrote in message
news:22982FEB-B70C-4968...@microsoft.com...

0 new messages