D
David Newmarch
I'm battling to see if I can adapt the code on the MSOffice Online assistance
article called "Basing one combo box on another".
(http://office.microsoft.com/en-us/assistance/HA011730581033.aspx)
My problem is that the article deals with one combo box based on another in
the same form. But I want a combo box in a subform to be based on the value
of a combo box on the main form, and so I suspect that code given in the
article, like the AfterUpdate event here,
Private Sub CategoryAfterUpdate()
Me.Product = Null
Me.Product.Requery
Me.Product = Me.Product.ItemData(0)
End Sub
would need to be adapted if the Category field was in the main form and the
Product field was in the subform.
I'm kind of blundering around trying to learn by trial and error, but it
would be a big help if I knew what "Me." means in that code, because I have a
hunch it's what I would need to change. I know it's a crucial bit of VBA
language (or whatever) because I see it all over the place, but not having
any kind of reference work available I can only guess at what it means.
Nobody ever seems to have offered an explanation of it that my web searches
have been able to pick up. Does it actually mean "me" like in English? In
which case would I simply replace it with the form name of the subform if
Procucts here was in a subform?
article called "Basing one combo box on another".
(http://office.microsoft.com/en-us/assistance/HA011730581033.aspx)
My problem is that the article deals with one combo box based on another in
the same form. But I want a combo box in a subform to be based on the value
of a combo box on the main form, and so I suspect that code given in the
article, like the AfterUpdate event here,
Private Sub CategoryAfterUpdate()
Me.Product = Null
Me.Product.Requery
Me.Product = Me.Product.ItemData(0)
End Sub
would need to be adapted if the Category field was in the main form and the
Product field was in the subform.
I'm kind of blundering around trying to learn by trial and error, but it
would be a big help if I knew what "Me." means in that code, because I have a
hunch it's what I would need to change. I know it's a crucial bit of VBA
language (or whatever) because I see it all over the place, but not having
any kind of reference work available I can only guess at what it means.
Nobody ever seems to have offered an explanation of it that my web searches
have been able to pick up. Does it actually mean "me" like in English? In
which case would I simply replace it with the form name of the subform if
Procucts here was in a subform?