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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup returns #Error 1

Status
Not open for further replies.

BobJacksonNCI

Technical User
Mar 11, 2003
725
US
I've used Dlookup before and never had trouble like this...

Working on an .ADP with Access 2000 front, SQL 7 back.

Report control contains:
=DLookUp("[CostCenter]","MgrTB_tlkpCostCenter","[Dept] = " & [Forms]![frm_TIME_OFF]![txtDept])

The form is open with data loaded.
Fields are text (char).

And it STILL returns #Error in the control when I
execute the report. Tried adding the table name in
front of [Dept] in case there is another [Dept]...
Also added dbo. in front of the table - nope.

Should be easy, but isn't so far.

Assistance IS appreciated!
 
Is txtDept a string value? If so, use:

=DLookUp("[CostCenter]","MgrTB_tlkpCostCenter","[Dept] = '" & [Forms]![frm_TIME_OFF]![txtDept] & "'")

John
 
Thanks, John.

Let's see, 8.07532913 seconds for your "ON THE BUTTON" reply!

Certainly worthy of a star!

(Yeah, experts reading this, it wasn't that tough a question. But, I'm sure there are many of us Access
novices who are going nuts with online help and manuals.
- I have 6, so far. This kind of assistance DOES bear recognition!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top