Setting subforms dataset on open of main form

C

Cyberwolf

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top