IIf function fails in report

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I am producing a report from a query. The query has a
field named CORP ADDRESS? that it gets from a table in the
database. CORP ADDRESS? is a true-false field indicating
whether a particular person gets their mail at the
corporate address or some other address.

Viewing the query shows that the values in this field are
either "True" or "False" as expected. When I create a
report with the [CORP ADDRESS?] field in it, the "True"
or "False" values show up correctly.

However, when I try to use that field in an IIf function
to get some more useful information in the report, the
result is always returns True. For instance:
=IIf([CORP ADDRESS?],"Company", "Home")
always results in "Company" being printed whether CORP
ADDRESS? is true or false.

What's wrong?
 
You need a test condition. I usually have 0 or -1 values
for my field, so it would be something like the following.

=IIf([CORP ADDRESS?]= -1,"Company", "Home")
 

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