Filtered Reports

D

dan.cawthorne

Hello,

Is there a bit of VB Coding i can use on the onclick event of a report
button that will only only show the filtered results what are shown on
the form.

I know i could have various query's and Buttons, But its just to long
winded and copying the reports etc, is a longish process,

What it is i have various filters on my form,

Such Toggle Buttons for A-Z and i Have Unbound List Box Which has a
Macro Assigned on the after update,

which this filters out company's by their discipline.

Using the one Report I Managed to use the following

Print All Which Just looks at the table,

the other button i have Print Current which the OnClick event is

DoCmd.OpenReport "View All Clients", acViewPreview, , "[CompanyID] =
'" & [Company ID] & "'"

What I'm trying to achieve is,

If The A Toggle button is pressed the print all will only filter the A
Company's on the report, or if the ALL toggle is selected everything
printed. or if i select Architects on the List valve box filter all
Architect Company's Will Be Printed.

Is there a OR Type Criteria i can Use?
 
D

dan.cawthorne

I Managed to use this code and it does the job nicely

DoCmd.OpenReport "View All Clients", acViewPreview, , Me.Filter

But only when the FLTR is Activated on the form,

is there a if else criteria that prints all records if filter is off?
 

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