Setting Source Object Property of a subform

P

Peter

I have a form that has a drop down combo box with names of all the
tables in the DB. Then I have a sub form that I want to display a table
based on what the user chooses from the drop down box.
How do I change the Source Object Property of the subform based on the
value chosen in the dropdown box?
 
G

George Nicholson

in cboTableList_AfterUpdate:

to simply show a table in an "empty" subform control (not a form in the
subform control)
Me.SubformControlName.SourceObject = cboTableList

to change the RecordSource of a form in a subform control
Me.SubformControlName.Form.Recordsource = cboTableList

HTH,
 

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