DLOOKUP returns #Error regardless of what I do. ARGH! Help!

dab1477

Board Regular
Joined
Jul 30, 2002
Messages
65
Need help, please. I'm frustrated. I have a form where I want to display a value from a table, based upon the selection from a combo box in the same form.

For instance. If Combo Box 1 is named CELL NAME. Display box on form is named GOAL-UPH. If my combo box named CELL name = SPECIALTY RF 1, I want DISPLAY Box named GOAL-UPH to return the number 88. The number 88 come from a table holding data for a variety of Cell Names.

The lookup table looks like this...
ID Dept. CellName Winter Staff Summer Staff Goal - UPH Goal-U/LH Goal - MPU
1 WS Velux/YKK 3.00 3.00 90 30 2
2 WS PlyGem DH 3.00 3.00 90 30 2
3 WS Specialty RF 1 3.00 3.00 88 29.3 2.05
4 WS Specialty RF 2 4.00 4.00 100 25 2.4
5 WS Clatyton/PlyGem 5.00 5.00 120 24 2.5
6 WS Rivet Cell 1 7.00 7.00 390 60 1
7 WS Rivet Cell 2 7.00 7.00 129 18.4 3.26
8 WS Ply Gem SH 2 5.00 5.00 360 72 0.83

All the numbers above are formatted in the table as General Number. All text is Short Text format.

My DLOOKUP for the GOAL-UPH box on the form (I have this in Control Source of properties) wanting to return the value based upon Cell Name on form, looks like this...

=DLookUp("Goal-UPH","tbl_celldataTN","cellname=" & [Cell Name])
The properties box for this GOAL-UPH box is set to Text Format = Plain TEXT.

I've also tried =DLookUp("[Goal-UPH]","[tbl_celldataTN]","[cellname]=" & [Cell Name]) without success.

This should work, but it returns #Error . I've researched this forum and multiple internet sites and I am not seeing my flaw. Can someone help me get pointed in the right direction? Thank you.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
if the info you posted is correct the first thing that shows is that the field name GOAL-UPH actually contains two extra spaces around the dash so it actually is "[Goal - UPH]".
 
Upvote 0
If cellname is a text value then you need to pass it as a text value:

Code:
DLookUp("[Goal-UPH]","[tbl_celldataTN]","[cellname]= [COLOR=#ff0000]'[/COLOR]" & [Cell Name][COLOR=#ff0000]&"'"[/COLOR])
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,543
Messages
6,120,123
Members
448,947
Latest member
test111

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