Avatar of terpsichore
terpsichore
 asked on

A quick one - setting filter based on calculated control

Dear experts -
I am trying to set a filter on a subform based on a control on that subform. The control in question is a checkbox, which is based on a formula (a complex one).

I am attempting to build a string and then setting the filter on the subform to that checkbox being true. I look at the subform BEFORE applying the filter and the checkbox is showing up as correctly checked.

I then apply the filter, using the code below, and no records appear.

    If Me!chkNeed2ndApp = True Then strfilter = strfilter & " and [Forms]![Project].sfPartsLines.Form.chkNeed2ndApp = TRUE"

Open in new window


(Me!chkNeed2ndApp is the control in the parent form that invokes the filtering sub)

Any idea what's wrong with my syntax/approach?

Many thanks.
Microsoft Access

Avatar of undefined
Last Comment
terpsichore

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scott McDaniel (EE MVE )

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
terpsichore

ASKER
thank you - this led me to the solution.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy