Updating a listbox on a form when using filter by selection

G

Guest

hopefully there is a simple solution for this one ...

I have a form which contains a series of textboxes and a list box which is
referenced a table, (eg Table2). The purpose of the textboxes is to list
individual fields of a single record, and the listbox (which resides in the
footer) is used to display all of the records.

Here is where I am having a problem...
when I select one of the text boxes and do a filter by selection, it of
course filters the records, and using the navigation buttons at the bottom of
the form, I can see the information that the record contains. Great! The
problem is that I want the listbox to show the rest of the filtered records
in a tabular form, however presently it shows all records. Is there a simple
way to accomplish this without having to write a query for each field? I'm
new to database authoring, so I'm assuming that I'm missing something basic
here. Thanks for any advice anyone can offer!
 
G

Guest

Hi godadj,

If you use the ater update event of the textbox that triggers the filter,
then use much the same code to create the rowsource for the listbox, eg;

Me.myListBox.RowSource = "SELECT * From Table2 WHERE TableID = " &
Me.txtBoxForFilter & "")

Or similar,

TonyT..
 

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