Solved

Dlookup

Posted on 2015-01-22
4
143 Views
Last Modified: 2015-01-22
Experts,

I have the follwoiung in the control source of a field.
I get a #name

is this correct?
=DLookUp([Amount],[tblDisbursement_Amounts],"[ID_disb]=" & [ID_disb])
0
Comment
Question by:pdvsa
4 Comments
 
LVL 35

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40564877
No.  Each argument must be enclosed in double quotes.

=DLookUp("[Amount]","[tblDisbursement_Amounts]","[ID_disb]=" & [ID_disb])

You also have to be careful with the Name property of a control.  If the control is unbound, as this one is, the Name property cannot be the same value as any field that is bound to the form.  This mistake usually happens when you reuse a control that was added by the wizard or by dragging a field from the field list since in both those cases, Access gives the control Name the value of the bound field.  So, if you originally had a bound field named [Amount] and then changed the expression to this Dlookup() and didn't change the control name, there would be a conflict.
0
 
LVL 57
ID: 40564878
All the arguments need quotes:

=DLookUp("[Amount]","[tblDisbursement_Amounts]","[ID_disb]=" & [ID_disb])

Jim.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40565040
You can get help and examples on any Access function here:
http://www.techonthenet.com/access/functions/domain/dlookup.php
0
 

Author Closing Comment

by:pdvsa
ID: 40565077
Thank you.  works perfectly.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

840 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