Solved Report filtering (1 Viewer)

Atthe

Member
Local time
Today, 16:51
Joined
Oct 26, 2021
Messages
57
Hi All,

I have a form which generates a report based on combobox selection, I need to be able to filter based on the entry in 1 field which is to be selected with a option control. I have set this up with queries but not sure how to best handle the multiple options?

At the minute for the first option I have:

Code:
DoCmd.OpenReport "rptSetupSheet", acPreview, "FilterTooling", Me.filtertooling = True

This works fine when true but if false the report is blank, Do I need an If statement to loop through the different options? or is there an easier way to handle this

Thanks for any help/advice
 

CJ_London

Super Moderator
Staff member
Local time
Today, 16:51
Joined
Feb 19, 2013
Messages
16,607
You need to make it equal to something

perhaps

‘[toolingtype]=“ & me.filtertooling
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:51
Joined
May 7, 2009
Messages
19,233
you should be able to filter by concatenating your Options control:

DoCmd.OpenReport "rptSetupSheet", acPreview, "FilterTooling", _
"[filterToolinFieldName] = " & Nz(Me.filtertooling, False) & " And " & _
"[AnotherYesNoFieldName] = " & Nz(Me!anotherOptionControlNameHere, False) & " And " & _
"[YetAnotherYesNoFieldName] = " & Nz(Me.YetAnotherOptionControlNameHere, False)
 

Users who are viewing this thread

Top Bottom