Solved

How use DLookup on a report

Posted on 2011-03-17
3
274 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
3 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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.

832 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