Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup, with refrences to other code looking at pricegrid

Status
Not open for further replies.

MightyRoo

Programmer
Jan 5, 2005
22
US
Hello, I am completely stumped and would greatly appreciate some direction.

I have some code that develops the following
AWidth=Adjusted Width
ALength=Adjusted Length
I have verified the AWidth and ALength formulas are working.

I have a table call pricegrid
It looks like this just much larger...
AutoID length 24 36 42 60...
1 36 100 120 140 160
2 42 110 135 150 175
3 48 120 140 155 180
I need to use the dlookup or another method to find a price in the table.

The following works...
price = DLookup("[36]", "TblPrices", "[length] = 42")

I need something like this to work, However I keep getting the wrong data...
price = DLookup([AWidth], "TblPrices", "[length] = [ALength")
The Dlookup statement seems to be missing something.


Thanks in advance,

Scott
 
Perhaps this ?
price = DLookup("[" & AWidth & "]", "TblPrices", "[length] = " & ALength)

Or this (if AWidth and ALength are controls):
price = DLookup("[" & Me!AWidth & "]", "TblPrices", "[length] = " & Me!ALength)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,
Thanks the...
price = DLookup("[" & AWidth & "]", "TblPrices", "[length] = " & ALength)

Works great. Thanks a million!
Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top