Hi,
I appreciate this may be a silly question, but I'm tying myself in knots and can't believe something I'm trying to do is turning out to be so difficult.
I have a main/sub form set up where the sub form is set to show a datasheet view of associate records. I have a combo box that looks up a Product Code from a separate table:
This works perfectly.
I am looking to bring through the ProductName in a new field when the combo box is changed - just so the user knows that have chosen the correct value. I have tried using a dlookup in the expression builder but get errors. I'm guessing that I have some syntax wrong, but I'm going in circles now ..
My desired result would look like
ProductCode..ProductName
AAAAAAAAA..ProductA
BBBBBBBBB..ProductB
AAAAAAAAA..ProductA
CCCCCCCCC..ProductC
Please can you put me out of my mystery :banghead:
I appreciate this may be a silly question, but I'm tying myself in knots and can't believe something I'm trying to do is turning out to be so difficult.
I have a main/sub form set up where the sub form is set to show a datasheet view of associate records. I have a combo box that looks up a Product Code from a separate table:
Code:
SELECT [lkp_ProductList].[ID], [lkp_ProductList].[ProductCode]
FROM lkp_ProductList
ORDER BY [ProductCode];
This works perfectly.
I am looking to bring through the ProductName in a new field when the combo box is changed - just so the user knows that have chosen the correct value. I have tried using a dlookup in the expression builder but get errors. I'm guessing that I have some syntax wrong, but I'm going in circles now ..
Code:
=DLookUp("[ProductName]","lkp_ProductList","[ProductCode]=[cmb_ProductCode]")
My desired result would look like
ProductCode..ProductName
AAAAAAAAA..ProductA
BBBBBBBBB..ProductB
AAAAAAAAA..ProductA
CCCCCCCCC..ProductC
Please can you put me out of my mystery :banghead:
Last edited: