I am trying to set the RecordSource property of a subform in order to display the results of a query.
My code is similar to
Dim strSQL as String
strSQL = "Select statement"
Forms!Main_Form!Sub_Form.RecordSource = strSQL
When the form executes I get the error message
"Object doesn't support this property or method" on the Forms line.
I have chnaged the Forms line to be ...!.RecordSource = ...
both give the same error message.
Any thoughts on how I can make this code work?
Thanks
My code is similar to
Dim strSQL as String
strSQL = "Select statement"
Forms!Main_Form!Sub_Form.RecordSource = strSQL
When the form executes I get the error message
"Object doesn't support this property or method" on the Forms line.
I have chnaged the Forms line to be ...!.RecordSource = ...
both give the same error message.
Any thoughts on how I can make this code work?
Thanks