Solved

Dlookup

Posted on 2015-01-22
4
146 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
[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
4 Comments
 
LVL 37

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 58
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

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

728 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