New to access and vba.
I have a bound main form (FormA) with a combobox on it and two unbound subforms (subfrmA & subfrmB). (Both forms are attached to a table however I want them to load onto the main form where I placed an unbound subform as a placeholder)
The combobox has two values “a” and “b.” When a is selected I want subfrm A to load onto Form A. When b is selected I want subfrmB to load onto Form A. — So far I think have this part working
However when I select a record on the main form the associated subforms doesn’t appear. When I try to link the subforms to the main form an error message appears saying I can’t build a link between unbound forms.
The packageID is the link between the main form and subform snd is a hidden field on all forms. Whenever the packageID is automatically updated the psckageID in the subform fields are also updated.
Case”A”
Me.subfrmAB.SourceObject=“FormA
Me.packageDetailsID=Me.subfrmAB.packageDetailsID
Case “B”
Me.subfrmAB.SourceObject=“FormB”
Me.packageDetailsID=Me.subfrmAB.packageDetailsID
question from:
https://stackoverflow.com/questions/65924972/access-how-to-link-dynamically-loaded-unbounded-subforms-to-main-form 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…