Syntax for Dlookup in table

hardrock

Registered User.
Local time
Today, 23:09
Joined
Apr 5, 2007
Messages
166
Hi all, instead of doing a dlookup via a query, i'd like to do a dlookup for price direct in a table where the criteria is the value in Text1 from Form1

outt = Nz(DLookup("[Price]", "Table1")) Where Product = ' Text1' from Form1

Whats the correct syntax for this please? Thanks
 
Code:
outt = Nz(DLookup("[Price]", "Table1","[Product]='" & Me.Text1 & "'"

That's assuming that the code is on the same form as the text box "Text1"
 
There's a couple of brackets missing.

Code:
outt = Nz(DLookup("[Price]", "Table1","[Product]='" & Me.Text1 & "'"))

Chris
 

Users who are viewing this thread

Back
Top Bottom