Use different sub form depending on the entry in a combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that list lot# and grades. I have a form set up that will
alow entry of the lot number and grade and various sub forms to allow entry
of other data. However, one set of data depends on the grade. For grade A I
need to know info one two and three, while for grade B I need to know info
four, five and six.

I have seperate tables set up for grade A and grade B to record this data.

If the use selects grade A in the main form combo box. How do I get a
subform to display that is specific to grade A?
 
Put both subforms on your main form and set their Visible property to
False. In the AfterUpdate event of the combobox, you'll need to write
some code:

Select Case Me.cboGrade
Case "A"
Me.sfrmSubformA.Visible = True
Me.sfrmSubformB.Visible = False
Case "B"
Me.sfrmSubformB.Visible = True
Me.sfrmSubformA.Visible = False
End Select

Barry
 
Back
Top