On a report, print field A or field B based on value in field C

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a membership database with name, address, etc. and a query of those
members who have paid current dues. I want to generate a report that
includes all people in the query and some of the fields. Depending on the
value in field A (yes or no) I want to print field B or field C. I tried
setting this up in a control source in a text box but it prints #Error and
the field shows a circular reference. Do I have the wrong type of box or am
I using the wrong field?
 
Gary

Is there a reason you are trying to do this in the report definition itself?

Consider using the IIF() function in the underlying query to generate the
output you want your report to use.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Is there an example of this in a query?

Jeff Boyce said:
Gary

Is there a reason you are trying to do this in the report definition itself?

Consider using the IIF() function in the underlying query to generate the
output you want your report to use.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Undoubtedly, but I have no ready reference. If I were doing this, I would
create a new "field" in a query, something like:

NewField: IIF(A,B,C)

and look up the exact syntax for the IIF() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thanks, That's what I did. It appears my error was trying to use the IIF
control inside an existing named field, rather than create a new one. Thus,
I kept getting the circular error. It works in either place, but serves my
purpose on the report perfectly. Thanks for your time.
 
Back
Top