Link a menu Tab to a subform (Combo Box)

A

Alimbilo

Hello,
How can I link a sub menu Tab (in a combo box) to open a subform?

Example:
In the Combo Box, I have - Age, - Gender, - Country

And I want the Age Form to open as a SUBFORM when I click on the -Age (in
the combo box).

Thank you
 
D

Damon Heron

Place the subform on the form and set its visible property to false.
In the afterupdate event of the combobox, enter:

If yourcomboboxName.text= "Age" then
me!yoursubformName.Form.Visible= true
else
me!yoursubformName.Form.Visible= false
end if

HTH
Damon
 
G

George Nicholson

use one subform control and change its SourceObject property bsaed on the
selection.

Select Case cboFormList
Case "Age"
me.SubformControlName.SourceObject = "frmAge"
Case "Country"
me.SubformControlName.SourceObject = "frmCountry"
etc...

Of course, if one of the columns in your combo ncluded the form name you
could use that directly:

Me.SubformControlName.SourceObject = cboFormList.Column(2)
 
Top