Open Subform when choice a ComboBox in main form

  • Thread starter Thread starter Muttley
  • Start date Start date
M

Muttley

Hi


I want builind a Form (unbound) with a Combobox and after the user
choice in Combo, I want call a subform with key choice in the combo


How can I do it ?


tks
 
In the after update event of the combo enter the code

Select case me.ComboBoxName
case 1
Me.Form2.SourceObject = "FormName1"
case 2
Me.Form2.SourceObject = "FormName2"
case 3
Me.Form2.SourceObject = "FormName3"
End select
 
Thanks , But I have only One Form and only 1 Subform

In the Combobox I choice a key

I have 2 tables as:

Table 1:
Id_Class
Id_Member

Table 2

Id_Class
Id_Member
Date_class
Observation
etc

I want choice Class in the Combo and choice a Date in the father Form
then populate Table 2 with Id_Class, Id_members and date choiced in the
father form

Example:
Table 1
Id_Class Id_Member
1 2
1 3
1 5
1 7
2 10
2 15
2 20
...... etc

When The user Choice Id_Class = 1 in the Combo and a Date Form I Want
populate Table 2 and open subform, but I do know link Forms
 
The record source of the subform should be with a filter that has a reference
to the main form

Select * From Table1 Where Id_Class = forms![MainFormName]![ComboName] And
Date_class = forms![MainFormName]![DateTextBox]

On the after update of this field, the combo And the date, write the code
Me.SubFormName.requry

Date_class
 
Back
Top