DLookup

Tarah

New member
Local time
Today, 16:10
Joined
Aug 18, 2004
Messages
8
I'm trying to use the DLookup function in the Control source of a text box. I am trying to look up a product name using the product code. as soon as i click off of the text box (to save or whatever) its going away...

=DLookup("[Flavor]", "tblFlavors", "[ProductCode] =" _
& Reports![ProductionRptOption2]!ProductCode)

bad symantics?? or maybe just a bad operator ;)
 
Try:
Code:
=DLookup("[Flavor]", "tblFlavors", "[ProductCode]='" _
& Reports![ProductionRptOption2]!ProductCode & "'")
 
I have never tried to use DLookup with the criteria as you have selected. One big question comes to mind before attempting any solution.

Where is this text box located? If it is on the ProductionRptOption2 report, you do not need to use DLookup. If the report is tied to a query or SQL statement, just make the control source of the text box the same as the Product Code field that is already in your report.

If the text box is not on the report, you might want to give us a better explanation of where it is located and what you are attempting to accomplish with the use of the DLookup function. I try not to use DLookup unless I absolutely have to.
 

Users who are viewing this thread

Back
Top Bottom