Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

reference subform dynamically Expand / Collapse
Posted Friday, June 27, 2014 8:12 AM


Group: General Forum Members
Last Login: Today @ 12:16 PM
Points: 144, Visits: 380
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?

Post #1586853
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse