Combo Box Controls Sub Form

P

paul

-Would like combo box named Item Group Major (No.1), on
the main form, control which sub form (No.2) comes up
based on the main form combo box selection. I have
multiple selections each with a different sub form. I.E.
Selection "Channel Letter" has a sub form named "fChannel
Letter Sub" and selection "Directional" has a sub form
named "fDirectional Sub".
-I added an event procedure to the after update field for
the main form combo box. (No.3)

Private Sub Item_Group_Major_AfterUpdate()
Select Case Me.[Item Group Major].Value
Case 1
Me.[Item Group Major].[Channel Letter] = "fChannel
Letter Sub"

Case 2
Me.[Item Group Major].[Directional]
= "fDirectional Sub"
End Select
End Sub

-I think I need to change the Source Object (No.4) on the
sub form to "look" at the Item Group Major selection but
am not sure how to do this seeing as it only allows me to
select forms, queries, tables and not specific fields,
I.E. Item Group Major.

-The sub form will require data entry specific to the
product line selected from the Item Group Major field and
will need to have the one to many relationship maintained
from the sub to the main form.

Can you help?

PS I've got a 389KB Word document with screen shots and
such that may help in explanation that I could e-mail
seperately. That's what the (No.1),(No.2), etc. are!!!
 
W

Wayne Morgan

You need to change the Source Object, , and of the subform control on the
main form. You may also have to issue a requery to the new subform after you
do this.

Me.NameOfSubformControl.SourceObject = "NameOfNewForm"
Me.NameOfSubformControl.LinkChildFields = "SubformFieldName"
Me.NameOfSubformControl.LinkMasterFields = "MainFormFieldName"

and, if needed,
Me.NameOfSubformControl.Form.Requery

I tried changing the SourceObject and that seemed to work. I haven't tested
the rest of this.
 

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