Filtering Records using a Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to use a paramater query to filter records when the field you
want to use as the filter is a list box?
 
Sonfitz,

You may filter a query by any field in a recordset. But understand that a
list box is a form control, not a field type.

*Fields* have a type (Number, Text, Memo, Hyperlink, etc.) and represent
columns of a Table. *Form controls* (Textbox, List Box, Combo Box, Option
Group, etc.) have no type, and are just a "container" for displaying data.
They may be Bound to a field in the form's underlying recordset or be Unbound.

Sprinks
 
You cannot show a list box in a parameter box that is popped up by a query.

In a query, you can refer to a list box on an open form, e.g.:
[Forms].[Form1].[Listbox2]
But for that to work the list box must have its MultiSelect property set to
None.
 
Thank you for replying so quickly, I was wrong in my description what I meant
was I created a table that has in that table, (Customer service), several
lookup fields that access other tables to get there information in a
"combo-box" These lookup fields work great. My form is based upon this
table which also works well however, I want to filter the form to display
certain records, and the filter I wanted to use is based upon a combo-box.

If I utilize a "filter by form" button it works fine but is there a way to
create a macro that would create a pop-up window to ask the infomation I need
in order to filter the recordset in a way that the "filter by form" button
does?

Thanks
 
How about putting a series of unbound combos in (say) the Form Header
section of your form, for filtering purposes, along with a command button to
apply the filter and another to remove the filter?

With that approach you can set up the filter combos so their Bound Column is
zero-width. The user can then choose a value in the combo without having to
see the actual number, but you can apply that number in the Filter of the
form.

If that sounds useful, and you are interested in the code to make that work
with several boxes, post a reply to this thread, and I will give post a
follow up with the code.
 

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

Back
Top