Using an IFF in an unbound text Box to diplay text

T

Tdahlman

I have a form in Access 2003 that will list inventories for me.
I have a Yes/No box named "Discontinued"

What I want to do is have a text box at the top of my form that displays the
words "DISCONTINUED" in bold red letters, but only if the [Discontinued] is
checked. Otherwise I want it to be blank.

This is what I have put for the control source in my empty text box.
=IFF([Discontinued]=-1,"DISCONTINUED","")

The text box displays "#Name?" all of the time with this formula in it.

Thank you in advance for your responose.
Travis
 
F

fredg

I have a form in Access 2003 that will list inventories for me.
I have a Yes/No box named "Discontinued"

What I want to do is have a text box at the top of my form that displays the
words "DISCONTINUED" in bold red letters, but only if the [Discontinued] is
checked. Otherwise I want it to be blank.

This is what I have put for the control source in my empty text box.
=IFF([Discontinued]=-1,"DISCONTINUED","")

The text box displays "#Name?" all of the time with this formula in it.

Thank you in advance for your responose.
Travis

The correct function name is "IIf" not "IFF".
=IIF([Discontinued]=-1,"DISCONTINUED","")
 
T

Tdahlman

HAHA.....I haven't done any real work on a database in about 6 months and
have clearly gotten a little sloppy since then.

Thanks for catching that. It works now.

Beetle said:
Probably because your using IFF when it should be IIf.
--
_________

Sean Bailey


Tdahlman said:
I have a form in Access 2003 that will list inventories for me.
I have a Yes/No box named "Discontinued"

What I want to do is have a text box at the top of my form that displays the
words "DISCONTINUED" in bold red letters, but only if the [Discontinued] is
checked. Otherwise I want it to be blank.

This is what I have put for the control source in my empty text box.
=IFF([Discontinued]=-1,"DISCONTINUED","")

The text box displays "#Name?" all of the time with this formula in it.

Thank you in advance for your responose.
Travis
 

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