Form Subform Combo box

S

Sean

I want to design a form and on the form I will have a list box with 5
selections, selections 1-5. Each one these selections corresponds to a
table of the same name. On my main form if I select one of these selections
from my list box, I want my subform to display the corresponding table. Can
someone get me started on this?

Thanks,
Sean
 
K

Klatuu

First, realize there is a difference between a subform control on a form and
the form being used as the subform. The subform control has a property named
Source Object. It contains the name of the subform to load.

You will need to create a form for each of the tables you want to use with
the table being the record source of the form.

To make it easier, I suggest you add a column to your list box control that
has the name of the subform that relates to each table. Now when you have
selected a table, you set the source object property of the subform control
to the name of the form that contains the selected table.

Assume your list box has 2 columns, Table name in Column(0) and Form Name in
Column(1).

Me.SubFormControlName.SourceObject = Me.ListBoxControlName.Column(1)
 

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