Google Gruppi non supporta più i nuovi post o le nuove iscrizioni Usenet. I contenuti storici continuano a essere visibili.

Filter listbox using combo box

81 visualizzazioni
Passa al primo messaggio da leggere

@discussions.microsoft.com Zoe

da leggere,
8 nov 2007, 17:52:0208/11/07
a
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

da leggere,
10 nov 2007, 09:44:3310/11/07
a
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 nuovi messaggi