DLOOKUP help

Xceller

Active Member
Joined
Aug 24, 2009
Messages
265
I have 2 tables. Table 1 is named Data, table 2 is named LOOKUP. The Data table contains 2 fields, Item and Price. The LOOKUP table contains 1 field, Item. I want to bring the price information to the LOOKUP table from the Data table by using the DLOOKUP function.

I created a query from the LOOKUP table. Here is my DLOOKUP function:

Price: DLookUp("[Price]","Data","[Item]=" & [Item])

It's giving my all #Error in the Price field. Am I doing something wrong?


Data:

Item-----------Price
TXTU8694----896,298
SZUL5554----719,461
FNLY9576----682,219


LOOKUP:

Item-----------Price
TXTU8694
SZUL5554


Desired result:

Query:
Item-----------Price
TXTU8694----896,298
SZUL5554----719,461
 
Last edited:

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
DLookup("FieldName" , "TableName" , "Criteria = n")

You have a Table called "Data" ?


Price: DLookUp("[Price]","Data","[Item]=" & [Item])
what does the bit in red relate to? it needs qualification with a tablename (since it appears to be a field name which is the same as a field in the search domain )


Maybe More Like

Price: DLookUp("[Price]","PriceList","[Item]=" & Mycode)


Also Item is a reserved word maybe try changing your table to ProductCode or something

Maybe better


Price: DLookUp("[Price]","PriceList","[ProductCode]=" & MyChosenProductcode)
 
Upvote 0
Yes, I have 2 tables. Table1: Data Table2: LOOKUP

Both tables contain the "Item" field. I want to bring the "Price" information from the Data table.

Since the Item is a reserved word, so I changed to ItemID in both tables and revised my DLOOKUP function:

Price: DLookUp("[Price]","Data","[ItemID]=" & [ItemID])

It still gives me the same #Error
 
Upvote 0

Forum statistics

Threads
1,214,657
Messages
6,120,769
Members
448,991
Latest member
Hanakoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top