How can I suppress the printing of a label for a value that is nul

A

Ariel

I have a database for which some of the values are null. It is a membership
list and it includes things like spouse's and children's names. For those
members who don't have either, I'd like to not have the lable show up at all.
I imagine there is a way to tell the program not to print the label for that
record, but I am not finding it.
 
A

Allen Browne

Create a query that uses your table.

In the Criteria row under the Spouse field, enter:
Is Not Null

On the next Criteria row down (i.e. below the row you just used) under the
Child field, enter:
Is Not Null

Use this query as the RecordSource for your report.
 
A

Ariel

That suppresses the entire record for any record that does not have a value
in that field. I want all the records to show, I just don't want the label
itself to show up like this:

Children:

With nothing next to it. I only want to suppress the label 'Children' if
the variable has no value in it but I STILL want that record to print the
rest of its info.

Ariel
 
A

Allen Browne

Ah: you just want to hide the label.

In report design view, right-click the label, and choose:
Change To | Text box.
Then set the Control Source of this text box to:
=IIf([Children] Is Null, Null, "Children:")

The text box will then contain the word children if the children field
contains a value (so it behaves like a label), but if the children field is
null, the text box will also be null.
 
A

Ariel

Yes! That works! Thank you!

Ariel

Allen Browne said:
Ah: you just want to hide the label.

In report design view, right-click the label, and choose:
Change To | Text box.
Then set the Control Source of this text box to:
=IIf([Children] Is Null, Null, "Children:")

The text box will then contain the word children if the children field
contains a value (so it behaves like a label), but if the children field is
null, the text box will also be null.

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

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

Ariel said:
That suppresses the entire record for any record that does not have a
value
in that field. I want all the records to show, I just don't want the
label
itself to show up like this:

Children:

With nothing next to it. I only want to suppress the label 'Children' if
the variable has no value in it but I STILL want that record to print the
rest of its info.

Ariel
 
D

Dan

As a follow-up, if I hide the label for a null field, how can I delete the
line, since it will be blank? There will be no other data on that line.
thanks,
Dan

Allen Browne said:
Ah: you just want to hide the label.

In report design view, right-click the label, and choose:
Change To | Text box.
Then set the Control Source of this text box to:
=IIf([Children] Is Null, Null, "Children:")

The text box will then contain the word children if the children field
contains a value (so it behaves like a label), but if the children field is
null, the text box will also be null.

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

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

Ariel said:
That suppresses the entire record for any record that does not have a
value
in that field. I want all the records to show, I just don't want the
label
itself to show up like this:

Children:

With nothing next to it. I only want to suppress the label 'Children' if
the variable has no value in it but I STILL want that record to print the
rest of its info.

Ariel
 
7

70s_RocknRoll

Did you get your question answered? I'm interested in deleting the line
too...PLEASE forward.
Thanks,
70s_RocknRoll

Dan said:
As a follow-up, if I hide the label for a null field, how can I delete the
line, since it will be blank? There will be no other data on that line.
thanks,
Dan

Allen Browne said:
Ah: you just want to hide the label.

In report design view, right-click the label, and choose:
Change To | Text box.
Then set the Control Source of this text box to:
=IIf([Children] Is Null, Null, "Children:")

The text box will then contain the word children if the children field
contains a value (so it behaves like a label), but if the children field is
null, the text box will also be null.

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

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

Ariel said:
That suppresses the entire record for any record that does not have a
value
in that field. I want all the records to show, I just don't want the
label
itself to show up like this:

Children:

With nothing next to it. I only want to suppress the label 'Children' if
the variable has no value in it but I STILL want that record to print the
rest of its info.

Ariel

:

Create a query that uses your table.

In the Criteria row under the Spouse field, enter:
Is Not Null

On the next Criteria row down (i.e. below the row you just used) under
the
Child field, enter:
Is Not Null

Use this query as the RecordSource for your report.

I have a database for which some of the values are null. It is a
membership
list and it includes things like spouse's and children's names. For
those
members who don't have either, I'd like to not have the lable show up
at
all.
I imagine there is a way to tell the program not to print the label for
that
record, but I am not finding it.
 

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