Nested sub form (1 Viewer)

Joy83

Member
Local time
Today, 16:08
Joined
Jan 9, 2020
Messages
116
Good Day,
I have an issue in referencing a filter for a nested sub form.
It is taking me longer than it should.. I am sure I can find the answer quickly here.

1- I have a subform named “ChildTest” in the main form name “FrmMain”
2- that subform is linked to another form named “FrmReqMain”
3- in that form there is a subform named “FrmReq” linked to another form named “FrmReq”

I want to make a filter in “FrmReq” based on a combo box in “FrmReqMain”

please note that I am accessing all from the main form “FrmMain”


Can you please help
 

isladogs

MVP / VIP
Local time
Today, 23:08
Joined
Jan 14, 2017
Messages
18,186
Just too slow. 😏
I was going to add exactly the same link which covers almost every scenario ... unless you are using the built in navigation forms.
 

Joy83

Member
Local time
Today, 16:08
Joined
Jan 9, 2020
Messages
116
Thanks ...
I tried that link before.. it didn’t work for me.
How to add the filter? Is ig considered a control or what..
Do you have a code example file ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:08
Joined
Oct 29, 2018
Messages
21,358
Thanks ...
I tried that link before.. it didn’t work for me.
How to add the filter? Is ig considered a control or what..
Do you have a code example file ?
Hi. Can you post a sample copy of your db with test data? Referring to subform controls requires using the precise name of the control. Sometimes, it may not be the same name as the Form it contains.
 

jdraw

Super Moderator
Staff member
Local time
Today, 19:08
Joined
Jan 23, 2006
Messages
15,364
I agree that seeing a copy of your database would be best approach.
However, you could review this video by Steve Bishop helps and/or its follow on video to see if the info helps resolve your issue.
Didn't work doesn't give readers any detail to work with.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 19:08
Joined
Feb 19, 2002
Messages
42,977
Rather than using filters, add criteria to the RecordSource queries of the subforms and when the criteria changes, requery the subform.

Select ...
From ...
Where SomeField = Forms! FrmReqMain!cboSomeField;

In the AfterUpdate event of cboSomeField:
Me. FrmReq.Requery
 

Joy83

Member
Local time
Today, 16:08
Joined
Jan 9, 2020
Messages
116
It worked
Many thanks to all of you
i knew this would save time!
I changed the filter to requery thanks Pat
 

Users who are viewing this thread

Top Bottom