Solved

Wrong number of arguments

Posted on 2016-10-07
2
44 Views
Last Modified: 2016-10-07
Experts,

I am trying to combine 2 separate statements that work into an iif.  I am getting a wrong number of arguments.  I have split them out separately to test and they work but when I combine them I get the error.  
Grateful for your help...

=IIf([PaymentMadeYN] <> "Yes",DSum("Amount","tblDraws_Details1","ID = " & [DrawIDrpmt], DSum("Amount","tblDraws_Details1","ID = " & [DrawIDrpmt] & " and PaymentMadeYN = '" & [PaymentMadeYN] & "'")+DSum("Amount","tblRePayment","DrawIDrpmt = " & [DrawIDrpmt] & " and PaymentMadeYN = 'Yes'"))
0
Comment
Question by:pdvsa
2 Comments
 
LVL 50

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41833140
quick try:
=IIf([PaymentMadeYN] <> "Yes", DSum("Amount","tblDraws_Details1","ID = " & [DrawIDrpmt]), DSum("Amount","tblDraws_Details1","ID = " & [DrawIDrpmt] & " and PaymentMadeYN = '" & [PaymentMadeYN] & "'")+DSum("Amount","tblRePayment","DrawIDrpmt = " & [DrawIDrpmt] & " and PaymentMadeYN = 'Yes'") 

Open in new window

0
 

Author Closing Comment

by:pdvsa
ID: 41833213
there was a  missing paren in your answer and I added it at the end of statement and it worked perfectly.  thank you
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

Title # Comments Views Activity
Access 2016 - query 23 56
Access Update Query 1 19
SQL Group on First occurrence 9 23
Cascading Combo boxes between 2 sub navigation forms 1 9
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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…
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…

815 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

10 Experts available now in Live!

Get 1:1 Help Now