Setting subforms dataset on open of main form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that contains a subform. The subforms dataset needs to sent to
1 of 4 tables based on what a user wants to see. I have the form built to
let the user choose which table to use, but I can not get it to populate the
subform. Here is what I have and get a runtime 438 "Objext doesn't support
this property or method."

stDocName = "frm:JCPTB"
DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria

Select Case OptCo

Case 1
Forms![frm:JCPTB]![JCPTB subform].RecordSource = "JCPBS Current TB"


Case 2
Forms![frm:JCPTB].RecordSource = "JCPFT Current TB"

Case 3
Forms![frm:JCPTB].RecordSource = "JCPKB Current TB"

Case 4
Forms![frm:JCPTB].RecordSource = "JCPRM Current TB"

End Select
 
Back
Top