Dlookup should work?

  • Thread starter Thread starter HJLatorre
  • Start date Start date
H

HJLatorre

Guest
I thought I understood Dlookup – but I am not able to make it work!

Here’s my scenario:

tbl_Details (GroupID, and other misc fields)
tbl_GroupList (AutoKey, GroupID, GroupName)
rpt_Report (GroupID, and other misc fields)


I would like my report to show the GroupName instead of GroupID (Data is entered as GroupID – hence, I created the look-up table “tbl_GroupList.”

I created a text box on my report:

=DLookup(“[GroupName]”,”[tbl_GroupList]”,”[GroupID] = Reports![rpt_Report]![GroupID]

I think my syntax is correct – I just can’t figure out why it won’t work. Do I need to link the tables?

I even tried DLookup in a query (changing the above code to fit the query fields) and can’t seem to make it work. Please help!

PS -- I don't think it matters, but I am trying to do this in a sub report.
 
Try basing your report on a query that joins the tables, then you will have groupname available to use as a controlsource on your report.
 
Thanks so much. . . .although I feel like a dork -- it was simple, it was there right in front of me!
 
For reference, the syntax should be more like this:

=DLookup(“[GroupName]”,”tbl_GroupList”,”[GroupID] = " & Reports![rpt_Report]![GroupID])
 

Users who are viewing this thread

Back
Top Bottom