Bob Quintal <rq******@sympatico.ca> wrote in
news:Xn**********************@207.35.177.135:
IF (NOT isnull(Me!MatlsList)) AND (Me!MatlsCost = 0 OR
isnull(Me!MatlsCost))
I'd not bother with the outer parens, but I'd add a pair of inner
parens:
IF (NOT isnull(Me!MatlsList)) AND ((Me!MatlsCost = 0) OR
isnull(Me!MatlsCost))
The reason is to make clear that (Me!MatlsCost = 0) is a single
expression being evaluated. I always feel it's important to surround
any comparison like that (= or < or > or <> or >= or <=) with parens
to make sure that the right thing is getting evaluated. Keep in mind
that this interpretation:
IF (NOT isnull(Me!MatlsList)) AND (Me!MatlsCost = (0 OR
isnull(Me!MatlsCost)))
would actually be valid, though it's nonsensical, and it forces an
evaluation that is the opposite of the default interpretation.
But, again, I don't believe in depending on default behaviors in
VBA, or in any implicit type coerction (which I think is related).
It may very well be reliable, but it's not good to depend on things
happening the way you expect them to when you can actually *force*
them to make them behave the way you want them to.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc