Can I NOT show labels & fields if the field is blank?

G

Guest

I have a report in which a given field will have data only rarely. Can I
suppress display of the label & field for that data in the event the field is
null, i.e. show the data only when there is data to show?

Appreciate your help.
 
A

Allen Browne

In report design view, change the label into a text box and you can suppress
it.

Say the text box is named City, so the label reads "City:".

1. In report design view, right-click the label, and:
Change To | Text box.

2. Set the Control Source of the new text box to:
=IIf([City] Is Null, Null, "City:")

3. Set the Can Shrink property to Yes for both City and this new text box.

4. Make sure there is nothing else on the report that overlaps verticallly
with this these text boxes.
 
G

Guest

Thanks for your help, but can I trouble you to help me with framing the
expression properly for a calculated field? The calculation in the query on
which the report is based is this:

CHOP-RCycle6+90dys: [CHOP-R6]+90

I am consistently "thrown" with how to word expressions such as the above.
(When do you use quotes? When do you use brackets?) I have made a few
attempts, but they have been vain.

Appreciate your assitance as always!
--
Thanks for your time!


Allen Browne said:
In report design view, change the label into a text box and you can suppress
it.

Say the text box is named City, so the label reads "City:".

1. In report design view, right-click the label, and:
Change To | Text box.

2. Set the Control Source of the new text box to:
=IIf([City] Is Null, Null, "City:")

3. Set the Can Shrink property to Yes for both City and this new text box.

4. Make sure there is nothing else on the report that overlaps verticallly
with this these text boxes.

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

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

Sue said:
I have a report in which a given field will have data only rarely. Can I
suppress display of the label & field for that data in the event the field
is
null, i.e. show the data only when there is data to show?

Appreciate your help.
 
A

Allen Browne

Assuming the label is attached to the text box named:
CHOP-RCycle6+90dys
use:
=IIf([CHOP-RCycle6+90dys] Is Null, Null, "Whatever:")


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

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

Sue said:
Thanks for your help, but can I trouble you to help me with framing the
expression properly for a calculated field? The calculation in the query
on
which the report is based is this:

CHOP-RCycle6+90dys: [CHOP-R6]+90

I am consistently "thrown" with how to word expressions such as the above.
(When do you use quotes? When do you use brackets?) I have made a few
attempts, but they have been vain.

Appreciate your assitance as always!
--
Thanks for your time!


Allen Browne said:
In report design view, change the label into a text box and you can
suppress
it.

Say the text box is named City, so the label reads "City:".

1. In report design view, right-click the label, and:
Change To | Text box.

2. Set the Control Source of the new text box to:
=IIf([City] Is Null, Null, "City:")

3. Set the Can Shrink property to Yes for both City and this new text
box.

4. Make sure there is nothing else on the report that overlaps
verticallly
with this these text boxes.

Sue said:
I have a report in which a given field will have data only rarely. Can I
suppress display of the label & field for that data in the event the
field
is
null, i.e. show the data only when there is data to show?

Appreciate your help.
 
G

Guest

I tired what I understood you to say & when I try viewing the report, I get
an "enter parameter: CHOP-RCycle6+90dys".

Here's what I've done:

I clicked "ab" on the toolbox & placed the controls.
I went to the label & changed it to a text box which reads
"CHOP-RCycle6+90dys".
In the text box, I entered the following:
=IIf([CHOP-RCycle6+90dys] Is Null,Null,"Whatever:")

I went back to the query on which the report is based. The field I'm trying
to "pull from" is this:

CHOP-RCycle6+90dys: [CHOP-R6]+90

Can you explain where I'm going wrong? Should I be using [CHOP-R6]+90 in the
expression, or CHOP-RCycle6+90dys ?

Thanks. Sorry to be a bother.
--
Thanks for your time!


Allen Browne said:
Assuming the label is attached to the text box named:
CHOP-RCycle6+90dys
use:
=IIf([CHOP-RCycle6+90dys] Is Null, Null, "Whatever:")


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

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

Sue said:
Thanks for your help, but can I trouble you to help me with framing the
expression properly for a calculated field? The calculation in the query
on
which the report is based is this:

CHOP-RCycle6+90dys: [CHOP-R6]+90

I am consistently "thrown" with how to word expressions such as the above.
(When do you use quotes? When do you use brackets?) I have made a few
attempts, but they have been vain.

Appreciate your assitance as always!
--
Thanks for your time!


Allen Browne said:
In report design view, change the label into a text box and you can
suppress
it.

Say the text box is named City, so the label reads "City:".

1. In report design view, right-click the label, and:
Change To | Text box.

2. Set the Control Source of the new text box to:
=IIf([City] Is Null, Null, "City:")

3. Set the Can Shrink property to Yes for both City and this new text
box.

4. Make sure there is nothing else on the report that overlaps
verticallly
with this these text boxes.

I have a report in which a given field will have data only rarely. Can I
suppress display of the label & field for that data in the event the
field
is
null, i.e. show the data only when there is data to show?

Appreciate your help.
 
A

Allen Browne

If Access is asking for a parameter, it means it cannot find the name you
used.

Check that the RecordSource property of the report is this query.

Then check what the name of the field is in that query.

Then use that name in square brackets in the expression.

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

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

Sue said:
I tired what I understood you to say & when I try viewing the report, I get
an "enter parameter: CHOP-RCycle6+90dys".

Here's what I've done:

I clicked "ab" on the toolbox & placed the controls.
I went to the label & changed it to a text box which reads
"CHOP-RCycle6+90dys".
In the text box, I entered the following:
=IIf([CHOP-RCycle6+90dys] Is Null,Null,"Whatever:")

I went back to the query on which the report is based. The field I'm
trying
to "pull from" is this:

CHOP-RCycle6+90dys: [CHOP-R6]+90

Can you explain where I'm going wrong? Should I be using [CHOP-R6]+90 in
the
expression, or CHOP-RCycle6+90dys ?

Thanks. Sorry to be a bother.
--
Thanks for your time!


Allen Browne said:
Assuming the label is attached to the text box named:
CHOP-RCycle6+90dys
use:
=IIf([CHOP-RCycle6+90dys] Is Null, Null, "Whatever:")


Sue said:
Thanks for your help, but can I trouble you to help me with framing the
expression properly for a calculated field? The calculation in the
query
on
which the report is based is this:

CHOP-RCycle6+90dys: [CHOP-R6]+90

I am consistently "thrown" with how to word expressions such as the
above.
(When do you use quotes? When do you use brackets?) I have made a few
attempts, but they have been vain.

Appreciate your assitance as always!
--
Thanks for your time!


:

In report design view, change the label into a text box and you can
suppress
it.

Say the text box is named City, so the label reads "City:".

1. In report design view, right-click the label, and:
Change To | Text box.

2. Set the Control Source of the new text box to:
=IIf([City] Is Null, Null, "City:")

3. Set the Can Shrink property to Yes for both City and this new text
box.

4. Make sure there is nothing else on the report that overlaps
verticallly
with this these text boxes.

I have a report in which a given field will have data only rarely.
Can I
suppress display of the label & field for that data in the event the
field
is
null, i.e. show the data only when there is data to show?

Appreciate your help.
 
G

Guest

This worked! Marvellously!
Thanks so much.
--
Thanks for your time!


Allen Browne said:
If Access is asking for a parameter, it means it cannot find the name you
used.

Check that the RecordSource property of the report is this query.

Then check what the name of the field is in that query.

Then use that name in square brackets in the expression.

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

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

Sue said:
I tired what I understood you to say & when I try viewing the report, I get
an "enter parameter: CHOP-RCycle6+90dys".

Here's what I've done:

I clicked "ab" on the toolbox & placed the controls.
I went to the label & changed it to a text box which reads
"CHOP-RCycle6+90dys".
In the text box, I entered the following:
=IIf([CHOP-RCycle6+90dys] Is Null,Null,"Whatever:")

I went back to the query on which the report is based. The field I'm
trying
to "pull from" is this:

CHOP-RCycle6+90dys: [CHOP-R6]+90

Can you explain where I'm going wrong? Should I be using [CHOP-R6]+90 in
the
expression, or CHOP-RCycle6+90dys ?

Thanks. Sorry to be a bother.
--
Thanks for your time!


Allen Browne said:
Assuming the label is attached to the text box named:
CHOP-RCycle6+90dys
use:
=IIf([CHOP-RCycle6+90dys] Is Null, Null, "Whatever:")


Thanks for your help, but can I trouble you to help me with framing the
expression properly for a calculated field? The calculation in the
query
on
which the report is based is this:

CHOP-RCycle6+90dys: [CHOP-R6]+90

I am consistently "thrown" with how to word expressions such as the
above.
(When do you use quotes? When do you use brackets?) I have made a few
attempts, but they have been vain.

Appreciate your assitance as always!
--
Thanks for your time!


:

In report design view, change the label into a text box and you can
suppress
it.

Say the text box is named City, so the label reads "City:".

1. In report design view, right-click the label, and:
Change To | Text box.

2. Set the Control Source of the new text box to:
=IIf([City] Is Null, Null, "City:")

3. Set the Can Shrink property to Yes for both City and this new text
box.

4. Make sure there is nothing else on the report that overlaps
verticallly
with this these text boxes.

I have a report in which a given field will have data only rarely.
Can I
suppress display of the label & field for that data in the event the
field
is
null, i.e. show the data only when there is data to show?

Appreciate your help.
 

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