Solved

Dlookup

Posted on 2016-08-15
4
55 Views
Last Modified: 2016-08-15
Hello, I am trying to substract 2 separate values in the following but I get a #error.  I imagine its a paren but not sure where.  thank you in advance.  

=DLookUp("Amount_ Aggregate","tblDraws","ID=" & [DrawIDrpmt])-DLookUp("Amount","tblDraws_Details1","DrawIDrpmt=" & [ DrawIDrpmt])
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
  • 2
4 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 41756030
you may break down your function into 2 parts...

first using your first part of function and see what was being returned?
=DLookUp("Amount_ Aggregate","tblDraws","ID=" & [DrawIDrpmt])

Open in new window

similarly, do the same for the 2nd function:
=DLookUp("Amount","tblDraws_Details1","DrawIDrpmt=" & [ DrawIDrpmt]) 

Open in new window

this will give you clue which part is getting an error and let you handle that error more efficiently.
0
 
LVL 52

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41756031
noticed that there was a space for "Amount_ Aggregate" ?
0
 
LVL 30

Expert Comment

by:hnasr
ID: 41756138
I imagine its a paren
Or missing Operator?

The first argument in DLookup is an expression where vba checks for missing operators.

DLookup ("x + 2", ...: Expression to look for value of field x + 2.

In what Rayan assumed, your code assumes, because of a space in the name,  a missing operator between assumed fields: "Amount_" and "Aggregate".
0
 

Author Closing Comment

by:pdvsa
ID: 41756148
That was it.  Thank you
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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.

626 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