Unanswered: Setting a subform's Source Object through code
I know I've gotten this to work in the past, so there must be something really obvious that I'm missing. I have a subform that will display one of several queries. I want to allow the user to select from a list (combo box), click a button, and have the query in datasheet view displayed in the subform.
This works fine if I define subform control's SourceObject in the properties window. But I get a run-time error when using code. The subform is named "chldQV". The master form is named "frmQueryViewer". The query name selected comes from the combo box, and it's the actual name of the query from the database objects window.
Private Sub Button_Click()
Dim vQryName as String
vQryName= "'" & cboQueryList & "'"
The error returned is "The Microsoft Jet database engine could not find the object '~sq_cfrmQueryViewer~sq_cchldQV"