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!

Where Clause in OpenReport Method 1

Status
Not open for further replies.

JulieFB

Programmer
Sep 8, 2006
10
0
0
CA
Hi,

On a form I have a drop down menu where users can multiselect Departments to include on a report. My report includes a detail section + 3 subreports in the report footer.

In my OnClick, I use the WHERE clause to indicate which departments to show on the report, but the WHERE clause only works for the detail section of my report, it wont pass to the subreports.

Any ideas on how to do this ? I am pretty desperate !!

Thanks a bunch !

Julie
 
I expect your "drop down menu" is actually a multi-select list box since a combo box allows you to select only a single value. There is a generic function for multi-select list boxes at
Another solution involves changing the SQL property of your subreport record source queries prior to opening 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]
 
Hi Duane,

Thank you for your reply.

Yes, my drop down is a multi-select list box, sorry for not mentionning this.

I looked at the first suggestion (since I had no idea what the 2nd suggestion ment, my Access is very basic!). When trying to insert the : IsSelectedVar("frmMultiselectListDemo","lboEmployeeID",[EmployeeID]) in my query, there is always a Expr1: that inserts itself in front. And then it doesnt work like it does so well in your example.

Any tips ?

Or maybe develop a bit on the 2nd suggestion ?

Thanks a bunch !

Julie
 
Duane,

I finally was able to make this work with your suggestion #1. Thanks so much for your help!

Have a great day!

Julie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top