Link to home
Start Free TrialLog in
Avatar of João serras-pereira
João serras-pereiraFlag for Portugal

asked on

subform is not filtered by link field

Hi -

'got a situation

On my app I have a form/subform set with a proper master/child linking field.
On the form the master is an unbound field which I fill up on load (it is invisible, but for debugging I made it visible) and it should filter the records to be shown in the subform.

However, in spite of verifying that the "unbound" field is f+duly filled up, the subform, shows always the entire table with no filetring at all.

the below screenshots show the problem.

This is driving me nuts because this part of my code was full operational 1.5 moths ago!


can anyone help?
User generated image

User generated image
User generated image
User generated image
SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The Master/Child links only work when both forms are bound.  If you are using an unbound main form and you want to filter the subform, change the subform's query to reference the filter field on the main form.

Where MyFK = Forms!frmMain!PK
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of João serras-pereira

ASKER

Hi! Thanks a lot!"
Just curious - what actually fixed it?
Unable to spot a problem within your presented info.

Try to reproduce the issue.

If you do upload the finding.
well ...
I have decompiled and compiled.... , changed the names for the linking fields, deleted the subform on the form and inserted a new control.... In the end I really do not know, so I tend to state that it was a sin (Something INside). In the end, the likely cause was the automatic thing that you get when you have a form/subform and ms/access ask you 3 options for showing the subform records which I deleted and manually inserted the relation.

In the future I will follow Scott's suggestion:

Me.sfModels.LinkChildFields = "MakeID"
Me.sfModels.LinkMasterFields = "txMakeID"

as I think it's the safest one.

thanks again

/joao