DLookup() in a query is very inefficient. Generally speaking you'd join the tables, like:
SELECT Tbl_COTag.[COLOR OUT1:], Tbl_HBColor.ColourName, Tbl_HBColor.FrenchTranslation
FROM Tbl_COTag INNER JOIN Tbl_HBColor ON Tbl_COTag.[COLOR OUT1:] = Tbl_HBColor.ColourName;
In the rare event that you needed a DLookup() it would look like:
DLookUp("ColourName","tbl_HBColor","ColourName = '" & [COLOR OUT1:] & "'")
Paul
------ Original Message ------
From: porag379@gmail.com
Sent: 6/24/2023 3:45:45 AM
Subject: Re: [MSAccessProfessionals] DLookup not working
Dear Sir,
Please find the attached my simple Access Database "TestData" where contained 2 Tables "Tbl_COTag" and "Tbl_HBColor" , actually "Tbl_HBColor" Table carried 2 fields "ColourName" and "FrenchTranslation" . And Table "Tbl_COTag" where field "COLOR OUT1:" stored value should be LOOKUP value from source Table "Tbl_HBColor" in field "ColurName" and "FrenchTranslation" to table "Tbl_COTag" in field "Lookup_HB_ENG_C" and "Lookup_HB_ENG_F"
Actually I need same as excel VLOOKUP function working process in Access Database using DLOOKUP function, for example I've attached both Access "TestData" and Excel "VLOOKUP_Excel" file for your better understanding.
If you give me clear Query example using DLOOKUP function in my attached "TestData" Access Database then it will best for me.
Thanks
Porag
Tidak ada komentar:
Posting Komentar