Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Report

Status
Not open for further replies.

phishfn

Technical User
Oct 3, 2003
10
US
This should be simple enough and I thought I had it working, but now I can't get it to.

I want a textbox in my report to display text based on a field value in a table. Here's what I mean:

If there's a '1' in my table, I want to display the word "English" on my report, a '2' in the table would display "Spanish", a '3' displays "French", and so on and so forth.

Here's what I was adding to my textbox, but it doesn't work:

=IIf([fldLanguage]=1,"English",IIf([fldLanguage]=2,"Spanish","French"))

Any help would be dearly appreciated.
 
Make sure the textbox name is not fldLanguage -- that causes a circular reference -- name it something like fldLanguage2. The control source cannot reference it's own textbox name.

TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
Set the control source to:
=Switch([fldLanguage],"English","Spanish","French")


Duane
MS Access MVP
 
Thanks both of you! The circular reference with the naming convention was the problem. And the =switch worked as well (c:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top