K
Kirk P.
I've got the following code in the After Update event of my combo box:
Dim strFilter As String
' Evaluate filter before it's passed to DLookup function.
strFilter = "[ProdID] = " & Me!cboProdID
' Look up product's Product Group and assign it to txtProdGrp control.
Me!txtProdGrp = DLookup("ProdGroup", "tblProducts", strFilter)
The code is returning the same Product Group for every ProdID in my form. I
think it's got something to do with my relationships. My combo box cboProdID
is on a subform based on tblEmplProd which has a many to one relationship
with tblProducts. The ProdID is associated with tblEmplProd, but ProdID
needs to be looked up in tblProducts to get to ProdGroup.
Hope this makes some sense. Thanks.
Dim strFilter As String
' Evaluate filter before it's passed to DLookup function.
strFilter = "[ProdID] = " & Me!cboProdID
' Look up product's Product Group and assign it to txtProdGrp control.
Me!txtProdGrp = DLookup("ProdGroup", "tblProducts", strFilter)
The code is returning the same Product Group for every ProdID in my form. I
think it's got something to do with my relationships. My combo box cboProdID
is on a subform based on tblEmplProd which has a many to one relationship
with tblProducts. The ProdID is associated with tblEmplProd, but ProdID
needs to be looked up in tblProducts to get to ProdGroup.
Hope this makes some sense. Thanks.