DLOOKUP question

Ben2k

Board Regular
Joined
Oct 16, 2002
Messages
77
Have the following

DLOOKUP("budgetunits","tbl_budget","dept='trade' AND month=[forms]![frm_input]![month]")

Is the syntax correct as it just returns #Name?

Thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hullo. Try this:
Code:
DLOOKUP("budgetunits","tbl_budget","dept='trade' AND month = " & [forms]![frm_input]![month] & ")

HTH (y)
P
 
Upvote 0
Slight error in the answer above.

=DLookup("budgetunits", "tbl_budget", "dept = 'trade' AND month = " & [forms]![frm_input]![month])
 
Upvote 0
Thanks guys,

I copied and pasted the second answer but it just says #Error on my form, is there anyway I can find out what the error is?

Ben
 
Upvote 0
=DLookup("budgetunits", "tbl_budget", "dept = 'trade' AND month = """ & [forms]![frm_input]![month] & """")
 
Upvote 0
As an aside,

Month, in Access, is a reserved word and is not advised as a field name.

Also, I'd question using a month in a field as a Date is always the preferred choice. You can simply get the Month as text from a date with the Format() function.

i.e.

....Format([MyDate, "mmmm") = """ & [Forms]![MyForm]![MyDate] & """")
 
Upvote 0

Forum statistics

Threads
1,221,783
Messages
6,161,913
Members
451,730
Latest member
BudgetGirl

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