terpsichore
asked on
SQL recordsource - refer to control on the subform?
Dear experts,
I have an issue where my subform is pulling all records, and I just need to view one, which will change dynamically based on other factors.
I wanted to put an unbound control in the form HEADER, then requery the record source, setting one key field to the value of that control.
How do I do this syntactically?
The thing is that this subform appears in several places, so putting a literal string showing the parent is not ideal, as the parent will differ. Or do I create a string in the load event building this, based on what the parent form(s) are?
Thanks!
I have an issue where my subform is pulling all records, and I just need to view one, which will change dynamically based on other factors.
I wanted to put an unbound control in the form HEADER, then requery the record source, setting one key field to the value of that control.
How do I do this syntactically?
The thing is that this subform appears in several places, so putting a literal string showing the parent is not ideal, as the parent will differ. Or do I create a string in the load event building this, based on what the parent form(s) are?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You also can simply use a hidden control on the parent form and then simply set the master link property on the subform control to reference the hidden control.
Unlike the child link, the master link can refer to a field or control on the parent.
Everything after that is automatic.
Jim.
Unlike the child link, the master link can refer to a field or control on the parent.
Everything after that is automatic.
Jim.
ASKER
Thank you both. I am tending to reprogram now and get rid of master/child links - I am finding much faster performance limiting the underlying recordset.
ASKER
I also am playing with Tempvars, as this will allow me to use the same variable name in both places.