DLookup Dilemma

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top