June 27, 2014 at 8:12 am
I have a subform on a main form that I want to change the recordsource. I have some code that loops and does this for several subforms on the main form. I need it to by dynamically, so I want to use variables.
Below is how I would do it hard coded.
Forms!MyMainForm.[MySubForm].Form.RecordSource = "SubQryTab02"
I tried this for dynamically:
Forms(MyMainForm).(MySubForm).Form.RecordSource = MySubQuery
What is the correct syntax?
August 2, 2014 at 7:35 am
Appologies for the late reply - been on a sabbatical. Did you get this issue resolved? If not, it should be possible to store the subform names and the different SQL strings in arrays and loop through the forms setting the record sources.
Wendell
Colorful Colorado
You can't see the view if you don't climb the mountain!
August 8, 2014 at 1:26 pm
Yes, I did resolve it...trial and error...then got it.
thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply