Hello,
I have a main form with two subforms. The second subform is not visible until the user clicks on a row within the first subform. Upon the second subform becoming visible on the main form, I would like to set the second subform's recordsource via code based on what the user has selected in the first subform.
I have this...
thearg is global variable off the main form which holds the table name
this could be done with selRec as well...both equal the name of table that I
want to be the record source.
selRec = fldCrseTitle.Text
selRec = selRec & ".fldClassNum"
Forms!frmMain.ClassSchedule.Form.RecordSource = "SELECT '" & selRec & "' FROM '" & thearg & "';"
I get error message stating "syntax error in query. Incomplete query clause."
Any ideas?
Thanks,
Mike
I have a main form with two subforms. The second subform is not visible until the user clicks on a row within the first subform. Upon the second subform becoming visible on the main form, I would like to set the second subform's recordsource via code based on what the user has selected in the first subform.
I have this...
thearg is global variable off the main form which holds the table name
this could be done with selRec as well...both equal the name of table that I
want to be the record source.
selRec = fldCrseTitle.Text
selRec = selRec & ".fldClassNum"
Forms!frmMain.ClassSchedule.Form.RecordSource = "SELECT '" & selRec & "' FROM '" & thearg & "';"
I get error message stating "syntax error in query. Incomplete query clause."
Any ideas?
Thanks,
Mike