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

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?
 
B

Barry Gilbert

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
 

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