Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dlookup

Posted on 2016-08-15
4
Medium Priority
?
58 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 53

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 53

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

704 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