Thank you both for your time and efforts.
The solution seems to be as I outlined it here. It works well and I am happy with it. So, as far as I'm concerned this question is closed unless someone else can come up with a better explanation or solution.
Perhaps, but the solution does work.
As I mentioned in regards to CJ_London's last post, Me.sfrmReportsControl.SourceObject = "Query.qryReports" also gives the same runtime error 2101. Also, the form is unbound and so the ChildLinkFields is not set.
Ok so here goes. I figured out the problem and a solution.
Problem:
1. If the ObjectSource = "" it can not be assinged an object (don't know why, but that is a fact).
2. Once the query is changed using CurrentDb.QueryDefs, the subform's ObjectSource evaluates to "".
And so...
If I use a form as the SourceObject of the subform I'll have to create a separate one for each combination of fields/tables (there are quite a few...).
In the designer, I set the SourceObject to qryReports. But even after the query is changed, those changes are not reflected until the form is closed and reopened.
What do you mean, the SourceObject can't be changed?
Tried:
Me.sfrmReportsControl.Requery
Doesn't make a difference.
Me.sfrmReportsControl.ControlSource = "qryReports"
Get a compile error: Method or data member not found.
Me.sfrmReportsControl.Form.ControlSource = "qryReports"
Get a runtime error 2465, Application-defined or object-defined error.
I have a subform which shows a query (dragged the query and dropped it on the main form).
I can set the query sql so:
CurrentDb.QueryDefs("qryReports").SQL ="SELECT...."But I can't get the subform to reflect the changes made to the querie's SQL unless the form is close and reopened.
How do I...
Hi Folks,
This one has me stumped. Using Win 7 32 bit Access 2010 32 bit, I can't get the property pane to open. Right-clicking the form or any of the controls and selecting Properties or Form Properties doesn't do a thing. How can I get the property pane to open.
Yes to both questions.
I don't have Office 2010 sp1 installed, so it may be a update related issue, although I haven't seen similar behavior reported in Access 2010. Will try updating (ran in to some difficulty) and post back.