Filtering a Bound Listbox

G

Guest

I have a form thats bound to a table (TABLES). On this form I have a listbox
that displays items from another table (ITEMS). TABLES has a one-to-many
relationship with ITEMS since several items may be in one table.

I would like the listbox on the bound form to automatically display the
items contained within the table currently displayed on the form, and for it
to update as i scroll through tables (using the navigation buttons below).

I've tried setting the rowsource of the listbox to select only those items
where the table equals the one currently selected, but this does not update
as I scroll through the records. Also, I've tried setting the control source
of the listbox to the ID text box on the form which contains the ID number of
the table, but this only selects the first ITEM in that table, and continues
to display all the other items.

My question is, how can I filter all the items not related to the table
selected out of the listbox?

Any suggestions would be greatly appreciated.
 
G

Guest

You are on the right track using the RowSource of the List Box to show only
items for the current table. You may not be doing it in the right place.
Try updating the list box's rowsource in the form's Current event. It fires
every time the current record changes, including when the form is loaded.
 

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