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
Author
Message
Posted Friday, June 27, 2014 8:12 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 12:56 PM
Points: 138, Visits: 365
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