shrinking null fields

  • Thread starter Thread starter Anna
  • Start date Start date
A

Anna

I am making a report where I don't want the labels to
appear if the field is null. I asked a question how to do
this last week and got this response:
Right-click the label for City, and choose Change to |
Text box.
Set the Control Source of the text box to:
=If(IsNull([City], Null, "City")

I have done this for one of my fields, but when I try to
run the report I get the error message:
Syntax error (comma) in query expression '[IF(IsNull
([Physical Appearance @ 25°C],Null,"[Physical Appearance @
25°C"))]'

If anyone could tell me what my problem is I would really
appreciate it! Thanks!
 
Hi,
Try this syntax:
=IIf(IsNull([City]), Null, "City")

-----Original Message-----
I am making a report where I don't want the labels to
appear if the field is null. I asked a question how to do
this last week and got this response:
Right-click the label for City, and choose Change to |
Text box.
Set the Control Source of the text box to:
=If(IsNull([City], Null, "City")

I have done this for one of my fields, but when I try to
run the report I get the error message:
Syntax error (comma) in query expression '[IF(IsNull
([Physical Appearance @ 25°C],Null,"[Physical Appearance
@
25°C"))]'

If anyone could tell me what my problem is I would really
appreciate it! Thanks!
.
 
I believe you want an IIF statement, not an IF statement.

--
Wayne Morgan
MS Access MVP


I am making a report where I don't want the labels to
appear if the field is null. I asked a question how to do
this last week and got this response:
Right-click the label for City, and choose Change to |
Text box.
Set the Control Source of the text box to:
=If(IsNull([City], Null, "City")

I have done this for one of my fields, but when I try to
run the report I get the error message:
Syntax error (comma) in query expression '[IF(IsNull
([Physical Appearance @ 25°C],Null,"[Physical Appearance @
25°C"))]'

If anyone could tell me what my problem is I would really
appreciate it! Thanks!
 
The expression in the Control Source of your text box:
1. Must begin with an equal sign;
2. Must have two i's for the Immediate If function;
3. Needs the closing bracket in the middle.
4. Needs to drop the square bracket around the outside.

=IIf(IsNull([Physical Appearance @ 25°C]), Null, "[Physical Appearance @
25°C")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I am making a report where I don't want the labels to
appear if the field is null. I asked a question how to do
this last week and got this response:
Right-click the label for City, and choose Change to |
Text box.
Set the Control Source of the text box to:
=If(IsNull([City], Null, "City")

I have done this for one of my fields, but when I try to
run the report I get the error message:
Syntax error (comma) in query expression '[IF(IsNull
([Physical Appearance @ 25°C],Null,"[Physical Appearance @
25°C"))]'

If anyone could tell me what my problem is I would really
appreciate it! Thanks!
 
Back
Top