Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Dlookup

Posted on 2016-08-15
4
Medium Priority
?
60 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
  • 2
4 Comments
 
LVL 54

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 54

Accepted Solution

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

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

916 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