Solved

How use DLookup on a report

Posted on 2011-03-17
3
272 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
Comment Utility
=DLookUp("[CapCat]","tblCapacityCategory","[CapCat] = " & Chr(34) & [txtCapCat] & Chr(34) )

mx
0
 

Author Closing Comment

by:SteveL13
Comment Utility
Perfect
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility

 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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

762 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now