Solved

Dlookup

Posted on 2016-08-15
4
41 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 49

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 49

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

706 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

11 Experts available now in Live!

Get 1:1 Help Now