Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How use DLookup on a report

Posted on 2011-03-17
3
Medium Priority
?
279 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 2000 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 58
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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

715 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