child/master problem

arage

Registered User.
Local time
Today, 11:25
Joined
Dec 30, 2000
Messages
537
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
 
You've already asked this once, use the criteria of the subform query to reference the listbox
 

Users who are viewing this thread

Back
Top Bottom