Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QUERY PROBLEMS... HELP!

Status
Not open for further replies.

mercwonder007

IS-IT--Management
Aug 12, 2005
33
US
I have a form with a bunch of unbound fields on it that have a query tied to them. I am using the form as a custom filter. When I type something in one of the unbound fields it then goes through the query and gives me the answer in a report. However, I now need to ad a list box to the filter that has items to choose from. I've tried this and when I run the query it shows everything regardless of what I have chosen. I hope I've worded this right. If anybody can please help I would sure appreciate it. Thank you

 
Can you explain how you expect the list box to filter the report? Placing a control on a form is nothing more than placing a control on a form.

Is your list box multi-select? How are you currently using the unbound [red]fields[/red]controls to filter your report?


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
All the unbound fields are tied to a query using the following code.

ex. on the form I have a field called "StreetName" and in the query i have the following code: [StreetName]=[forms]![frmFilter]![StreetName] OR [forms]![frmFilter]![StreetName] Is Null

That code works great however when I put in a list box, I tied it to a SQL Code to the table. I have it set for multiple select. When I choose some of the options from the list box it shows everything. It's as if it doesn't work at all.
 
You can't use a multi-select list box in a query without using code. You might want to check the FAQs in this and the Access Reports forum for some sample code.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top