Solved

Dlookup

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

786 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