Re: Access long expression - parenthsis problem



Keep going. Simplify it even more. Just make sure every expression you
replace with a letter is valid and works.

Wait. What you have does not seem to be a valid IIF expression, which is
supposed to have the form

Iif(test,truepart,falsepart)

What you have is more like:

Iif(stuff,1,morestuff,0,evenmorestuff)

This is guaranteed not to work.

Also, remember what i said about putting some whitespace in
.... 1and(Round ...

should be
.... 1 and (Round ...

Michelle wrote:
Hi Bob,

I simplified the expression, it may be clearer to look at. I am
desparate for help. Thanks a lot!


MajorRuralTax06:


IIf(((Round((X*((Y)+Z)+Q*(P+U+T))*0.001,2)<1and(Round((X*((Y)+Z)+Q*(P+U+
T))*0.001,2)>0),1,
(Round((X*((Y)+Z)+Q*(P+U+T))*0.001,2)=0,0,

IIf(Round((X*((Y)+Z)+Q*(W+V+T))*0.001,2)>1,Round((X*((Y)+Z)+Q*(P+V+T))*0
..001,2))))


Michelle

"Bob Barrows [MVP]" wrote:

Michelle wrote:
Hello,

My long expression has driven me crazy for the past few days. there
are too many parenthsises. I need someone with clearer mind to help.
The message is 'The expression you entered is missing a closing
parenthesis, bracket(]), or vertical bar'. Your help would be highly
appreciated.

The basis of this expression is: iif([x]<1 and
[x]>0,=1,iif[x]=0,0,iif[x]>1,calculated value)

MajorRuralTax06:


IIf(((Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]
))+nz([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResident
ial

Land06])+nz([SumOfRuralLand06])))*0.001,2)<1and(Round((nz([RuralMill06])

*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nz([ResiRuralMill06])*(nz([

NetResiBldgAssess06])+nz([SumOfResidentialLand06])+nz([SumOfRuralLand06]
)))*0.001,2)>0),1,(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([
Net

BldgAssess06]))+nz([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([Sum

OfResidentialLand06])+nz([SumOfRuralLand06])))*0.001,2)=0,0,IIf(Round((n

z([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nz([ResiRur

alMill06])*(nz([RoundResiBldgAssess06])+nz([SumOfResiLand06])+nz([SumOfR

uralLand06])))*0.001,2)>1,Round((nz([RuralMill06])*((nz([SumOfLand06]))+

nz([NetBldgAssess06]))+nz([ResiRuralMill06])*(nz([NetResiBldgAssess06])+
nz([SumOfResiLand06])+nz([SumOfRuralLand06])))*0.001,2))))

Well, I'm not going to tackle it, but if i was, I would start by
inserting a line break before each comma to get this:

IIf(

((Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+n

z([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResidentialLand
06])+nz([SumOfRuralLand06])))*0.001
,2)<1 and

(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nz

([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResidentialLand0
6])+nz([SumOfRuralLand06])))*0.001
,2)>0)
,1

,(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+n

z([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResidentialLand
06])+nz([SumOfRuralLand06])))*0.001
,2)=0
,0

,IIf(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06])
)+nz([ResiRuralMill06])*(nz([RoundResiBldgAssess06])+nz([SumOfResiLan
d06
])+nz([SumOfRuralLand06])))*0.001
,2)>1

,Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nz

([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResiLand06])+nz(
[SumOfRuralLand06])))*0.001
,2)))
)

Add some whitespace to make the mess more readable and apply some
indentation. Replace complicated sections of the expression with
keywords (which you will replace with the actual expressions later on
after you have the parentheses correct)
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


.



Relevant Pages

  • Re: Access long expression - parenthsis problem
    ... What you have does not seem to be a valid IIF expression, ... are too many parenthsises. ... Please reply to the newsgroup. ... a quicker response by posting to the newsgroup. ...
    (microsoft.public.data.ado)
  • Re: Access long expression - parenthsis problem
    ... it may be clearer to look at. ... My long expression has driven me crazy for the past few days. ... are too many parenthsises. ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • Re: Access long expression - parenthsis problem
    ... My long expression has driven me crazy for the past few days. ... are too many parenthsises. ... I need someone with clearer mind to help. ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • Re: Generate letters with fill-in boxes
    ... See the article "How to create a Userform" at: ... Please reply to the newsgroup unless you wish to avail yourself of my ... way to simplify this with fill in boxes? ...
    (microsoft.public.word.mailmerge.fields)
  • Folbot Aleut
    ... My Apologies if this is inappropriate for this newsgroup. ... I have an older Folbot Aleut. ... I'm trying to simplify a bit and I need to sell it. ...
    (rec.boats.paddle)