What Does +IIF Do as Opposed to IIF?

  • Thread starter Thread starter james.igoe
  • Start date Start date
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?
 
+IIf(UnmatchedDeals.System<>UMD2.System,"111","999") &
+IIf(UMD2.Index>UnmatchedDeals.Index,UMD2.Index,UnmatchedDeals.Index)
 
Those plus signs would appear to serve no useful purpose.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)
 
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.
 

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

Back
Top