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

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?
 
J

Jeff Boyce

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
 
G

Guest

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
 
J

Jeff Boyce

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
 
G

Guest

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.
 

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

Top