Solved

How use DLookup on a report

Posted on 2011-03-17
3
276 Views
Last Modified: 2013-11-05
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
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 35158833
=DLookUp("[CapCat]","tblCapacityCategory","[CapCat] = " & Chr(34) & [txtCapCat] & Chr(34) )

mx
0
 

Author Closing Comment

by:SteveL13
ID: 35158897
Perfect
0
 
LVL 57
ID: 35159077

 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question