Solved

Dlookup

Posted on 2015-01-22
4
141 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 34

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

863 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

28 Experts available now in Live!

Get 1:1 Help Now