What Does +IIF Do as Opposed to IIF?

D

Douglas J. Steele

AFAIK, there's no such function as +IIf in VBA. If I had to guess, I'd say
that the + is simply arithmetic: add the results of the IIf function to
whatever preceeded it.

How are you seeing it used?
 
J

james.igoe

+IIf(UnmatchedDeals.System<>UMD2.System,"111","999") &
+IIf(UMD2.Index>UnmatchedDeals.Index,UMD2.Index,UnmatchedDeals.Index)
 
D

Douglas J. Steele

Those plus signs would appear to serve no useful purpose.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)
 
B

BruceM

If you're trying to add the values, leave out the ampersand. The first +
sign doesn't seem to be doing anything. You can also use + as a
concatenation operator if you want the concatenation to return Null if any
of the values are Null. For instance:

[Address1] & Chr(13) & Chr(10) & ([Address2] + Chr(13) + Chr(10)) & [City]

will evaluate this part of the expression to Null if Address2 is null:
([Address2] + Chr(13) + Chr(10))

If there is no Address2 field, the carriage return and line feed Chr(13) +
Chr(10) become part of the null expression within parentheses, and are in
effect skipped, which means there won't be an empty space in the address
where the Address2 field would be.
 
Top