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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Annoying Problem

Status
Not open for further replies.

Blorf

Programmer
Dec 30, 2003
1,608
0
0
US
Hello. I have an annoying proglem (That I can work around) that I would like to solve, or at least understand.

In a report, I have two fields, (Lots more, but two that count for the problem)

First field is Description, second field is Type. Description is a text field, and Type is numeric, either a 0 or 1.

In my Description field, I want to display the Description only if type is zero, but not 1. I can do this with conditional formating, but this presents some other problems, like making my lines not show if they are near the conditional formatted field.

So, I set my form control to be
=iif([type]=0, [description, "")

This does not work, it just says "Error"

Why, and how do I fix it?

Thanks in advance.



Ascii dumb question, get a dumb Ansi
 
You are missing a "]". If this doesn't fix your issue then make sure the name of the text box is not the name of a field.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
In real life I am not missing ], but the name of the field is the same. Probably the problem. I dunno how I missed it.

Thank you very much.

ChaZ

Ascii dumb question, get a dumb Ansi
 
If you are still having the issue with your report, I would suggest going a slightly approach.

On Print (in the detail)

if me.type = 0 then me.description.visible = false
if me.type = 1 then me.description.visible = true

or vise versa depending on which value means what.
 
I won't add code to a report or form unless it became necessary. They will load faster if they have no code behind them.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top