• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

How use DLookup on a report

I have a text box on a report and am trying to do a DLookup for it.  Here's is what I have in Control Source but it's not working.

=DLookUp("[CapCat]","tblCapacityCategory","[CapCat] =& [txtCapCat]")

????
0
SteveL13
Asked:
SteveL13
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
=DLookUp("[CapCat]","tblCapacityCategory","[CapCat] = " & Chr(34) & [txtCapCat] & Chr(34) )

mx
0
 
SteveL13Author Commented:
Perfect
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:

 FYI, unless it's for some totally un-related data, you should avoid the use of Dlookup().  Instead, modify the query the report is based on and include the table(s) with the info you need.

JimD.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now