Report Error

J

JOM

I have an unbod textbox and I am getting an error that the expression you
entered has a function containing the wrong mumber of arguments....

This is how it looks like now....



="Out Of Standard: " &
Abs(Sum(IIf([TaxDocStatus]="Complete",(IIf((([TaxDocName] in("W2","1099") And
DateDiff("d",[RqstDateRcvd],[TxDocDateRcvd])-
DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],7)-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],1)>10)
Or [TaxDocName] in("1040", "1065","1120")And
DateDiff("d",[RqstDateRcvd],[TxDocDateRcvd]-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],7)-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],1))>2,1,0)))))
 
D

Douglas J. Steele

I don't claim to have looked at it extensively, but you seem to be missing a
closing parenthesis for the 3rd last DateDiff function, the one with
DateDiff("d",[RqstDateRcvd],[TxDocDateRcvd]
 
V

Van T. Dinh

(I may be incoorect in indenting later)

Copy the ControlSource to a NotePad and try to pair the parentheses like:

****
="Out Of Standard: " &
Abs
( Sum( IIf( [TaxDocStatus]="Complete",
( IIf( ( ( [TaxDocName] in ("W2","1099") And
DateDiff("d",[RqstDateRcvd],[TxDocDateRcvd]) -
DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],7) -
DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],1)>10
)
Or [TaxDocName] in ("1040", "1065","1120")
And DateDiff( "d",[RqstDateRcvd],[TxDocDateRcvd] {*} -
DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],7)
-
DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],1)
) > 2, 1, 0
)
)
)
)
)
****

and you see you are missing 1 closing parenthesis. If you add a closing
parenthesis where I marked {*} (same as Doug's advice) and re-indent, the
parentheses will probably match.

For simpler expressions, simply count opening and closing parentheses and
make sure that they match.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top