Set value of a text box conditionally

J

J. Cairn

I have two text boxes on a report. One is bound to a field in a table.
The other has a formula that combines the values from two other table
fields.

If there is a particular value in the bound field, I want the unbound
text box to display a particular text string, instead of the string
that it now displays as a result of the formula.

How do I do that? Thanks.
 
A

Armen Stein

I have two text boxes on a report. One is bound to a field in a table.
The other has a formula that combines the values from two other table
fields.

If there is a particular value in the bound field, I want the unbound
text box to display a particular text string, instead of the string
that it now displays as a result of the formula.

How do I do that? Thanks.

You can use an IIF (Immediate If), something like:

=IIF([boundcontrolname]="MySpecialValue", "My Particular String",
[insertoriginalformulahere])

In English this means:

If the bound control equals a particular value,
show a particular string
otherwise
show the results of a formula


Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 

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