child/master problem
I’m trying to dynamically create the master/child relationship between my forms unbound controls and its subform. I’m trying to issue 2 master fields and 2 child fields in vba code on the afterUpdate event of one of my main forms unbound control. Currently I’m prompted for a series of parameter values that should not be appearing & they all relate to the value of the unbound controls (2) as well as values for one of my child fields in the subform and my subform itself (apparently).
Here’s the code I placed in the update event of my main forms unbound controls.
* LstType and lstRegion are list boxes.
Private Sub lstRegion_AfterUpdate()
'establish linkMasterFields & linkChildFields in the subform...
Me![NewQuery subform].LinkMasterFields = "Me![lstType]; Me![lstRegion]"
Me![NewQuery subform].LinkChildFields = "Me![NewQuery subform].Form![PromotionType]; Me![NewQuery subform].Form![RegionalDirectorCode]"
End Sub
I’m trying to dynamically create the master/child relationship between my forms unbound controls and its subform. I’m trying to issue 2 master fields and 2 child fields in vba code on the afterUpdate event of one of my main forms unbound control. Currently I’m prompted for a series of parameter values that should not be appearing & they all relate to the value of the unbound controls (2) as well as values for one of my child fields in the subform and my subform itself (apparently).
Here’s the code I placed in the update event of my main forms unbound controls.
* LstType and lstRegion are list boxes.
Private Sub lstRegion_AfterUpdate()
'establish linkMasterFields & linkChildFields in the subform...
Me![NewQuery subform].LinkMasterFields = "Me![lstType]; Me![lstRegion]"
Me![NewQuery subform].LinkChildFields = "Me![NewQuery subform].Form![PromotionType]; Me![NewQuery subform].Form![RegionalDirectorCode]"
End Sub