Suppress Label for Blank Data

G

Guest

In the detail section of the report I have a label and the corresponding
data...how do I suppress the label if the data field is blank?
 
A

Allen Browne

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

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

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

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

message
news:[email protected]...
 
G

Guest

ok, it does suppress it however it now it leaves blank spaces....I even
changed the detail of the report & the text Box to can shrink....any thoughts?

Allen Browne said:
In report design view, right-click the label, and choose:
Change To | Text Box.

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

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

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

message
In the detail section of the report I have a label and the corresponding
data...how do I suppress the label if the data field is blank?
 
D

Duane Hookom

If a text box value is Null and its Can Shrink property is set to Yes, it
will shrink. What makes you think the text box doesn't shrink? Try display
the border to determine for sure if the control shrinks and your problem is
something else.

--
Duane Hookom
MS Access MVP

Please help James said:
ok, it does suppress it however it now it leaves blank spaces....I even
changed the detail of the report & the text Box to can shrink....any
thoughts?

Allen Browne said:
In report design view, right-click the label, and choose:
Change To | Text Box.

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

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

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

message
In the detail section of the report I have a label and the
corresponding
data...how do I suppress the label if the data field is blank?
 
G

Guest

ok, let me try to explain...in my report I have check boxes that I would like
displayed when there is a check, but what I don't want is for it to be
floating in the original location with all of this blank space in the
unchecked locations. In other words, if I have 10 check marks in a column
and 3 of them are checked (in any order), I would only like to display only
three in the space that only three check boxes can fit.

Duane Hookom said:
If a text box value is Null and its Can Shrink property is set to Yes, it
will shrink. What makes you think the text box doesn't shrink? Try display
the border to determine for sure if the control shrinks and your problem is
something else.

--
Duane Hookom
MS Access MVP

Please help James said:
ok, it does suppress it however it now it leaves blank spaces....I even
changed the detail of the report & the text Box to can shrink....any
thoughts?

Allen Browne said:
In report design view, right-click the label, and choose:
Change To | Text Box.

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

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

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

message
In the detail section of the report I have a label and the
corresponding
data...how do I suppress the label if the data field is blank?
 
A

Allen Browne

So you are trying to get rid of the *horizontal* space between check boxes?
CanShrink only applies to vertical space.

There is no way to have the check boxes move to the left, unless you write
code in the Format event of the (Detail?) section, to examine each field and
set the Left property of the ones to the right.

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

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

message
ok, let me try to explain...in my report I have check boxes that I would
like
displayed when there is a check, but what I don't want is for it to be
floating in the original location with all of this blank space in the
unchecked locations. In other words, if I have 10 check marks in a column
and 3 of them are checked (in any order), I would only like to display
only
three in the space that only three check boxes can fit.

Duane Hookom said:
If a text box value is Null and its Can Shrink property is set to Yes, it
will shrink. What makes you think the text box doesn't shrink? Try
display
the border to determine for sure if the control shrinks and your problem
is
something else.

--
Duane Hookom
MS Access MVP

Please help James said:
ok, it does suppress it however it now it leaves blank spaces....I even
changed the detail of the report & the text Box to can shrink....any
thoughts?

:

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

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

in
message
In the detail section of the report I have a label and the
corresponding
data...how do I suppress the label if the data field is blank?
 
G

Guest

Allen, getting rid of the horizonal space would be nice, however I'd be more
that happy to get rid of the Vertical space first. And for some reason with
check boxes the detail does not shrink, leaving the three check boxes one
after the other...instead the three boxes are displayed with empty space in
the location that the unchecked boxes would otherwise be.



Allen Browne said:
So you are trying to get rid of the *horizontal* space between check boxes?
CanShrink only applies to vertical space.

There is no way to have the check boxes move to the left, unless you write
code in the Format event of the (Detail?) section, to examine each field and
set the Left property of the ones to the right.

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

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

message
ok, let me try to explain...in my report I have check boxes that I would
like
displayed when there is a check, but what I don't want is for it to be
floating in the original location with all of this blank space in the
unchecked locations. In other words, if I have 10 check marks in a column
and 3 of them are checked (in any order), I would only like to display
only
three in the space that only three check boxes can fit.

Duane Hookom said:
If a text box value is Null and its Can Shrink property is set to Yes, it
will shrink. What makes you think the text box doesn't shrink? Try
display
the border to determine for sure if the control shrinks and your problem
is
something else.

--
Duane Hookom
MS Access MVP

message ok, it does suppress it however it now it leaves blank spaces....I even
changed the detail of the report & the text Box to can shrink....any
thoughts?

:

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

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

in
message
In the detail section of the report I have a label and the
corresponding
data...how do I suppress the label if the data field is blank?
 
A

Allen Browne

Are these check boxes bound to a Yes/No field?

If so, the value will not be Null, and so they will not shrink.
You could try using a text box bound to an expression in place of the check
box.

If the check box field is named Field1, add a text box to your report, and
set these properties:
Control Source =IIf([Field1]= True, "X", Null)
Can Shrink Yes
Name txtForField1

Now right-click the attached label of this text box, and:
Change To | Text Box
Set the ControlSource of this text box to:
=IIf([txtForField1] Is Null, Null, "Field 1")

This text box and its label can now shrink vertically.

Once you have that working, you can change the X into a check mark character
if you want. Set the font for this text box to Wingdings, and replace the X
(inside the quotes) with a character that you generate by holding down thw
Alt key while typing 0254 on the numeric keypad. Use 0252 if you want an
unboxed check mark.

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

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

message
Allen, getting rid of the horizonal space would be nice, however I'd be
more
that happy to get rid of the Vertical space first. And for some reason
with
check boxes the detail does not shrink, leaving the three check boxes one
after the other...instead the three boxes are displayed with empty space
in
the location that the unchecked boxes would otherwise be.



Allen Browne said:
So you are trying to get rid of the *horizontal* space between check
boxes?
CanShrink only applies to vertical space.

There is no way to have the check boxes move to the left, unless you
write
code in the Format event of the (Detail?) section, to examine each field
and
set the Left property of the ones to the right.

message
ok, let me try to explain...in my report I have check boxes that I
would
like
displayed when there is a check, but what I don't want is for it to be
floating in the original location with all of this blank space in the
unchecked locations. In other words, if I have 10 check marks in a
column
and 3 of them are checked (in any order), I would only like to display
only
three in the space that only three check boxes can fit.

:

If a text box value is Null and its Can Shrink property is set to Yes,
it
will shrink. What makes you think the text box doesn't shrink? Try
display
the border to determine for sure if the control shrinks and your
problem
is
something else.

--
Duane Hookom
MS Access MVP

in
message ok, it does suppress it however it now it leaves blank spaces....I
even
changed the detail of the report & the text Box to can shrink....any
thoughts?

:

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

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

"Please help James" <[email protected]>
wrote
in
message
In the detail section of the report I have a label and the
corresponding
data...how do I suppress the label if the data field is blank?
 
D

Duane Hookom

You might want to visit Allen's web page
http://www.allenbrowne.com/ser-52.html which swaps a check box for a text
box. You can set the control source to something like:
=IIf([YesNoField] = True, {Alt+0254},Null)
You have to enter the Alt+0254 as per his description.

--
Duane Hookom
MS Access MVP


Please help James said:
Allen, getting rid of the horizonal space would be nice, however I'd be
more
that happy to get rid of the Vertical space first. And for some reason
with
check boxes the detail does not shrink, leaving the three check boxes one
after the other...instead the three boxes are displayed with empty space
in
the location that the unchecked boxes would otherwise be.



Allen Browne said:
So you are trying to get rid of the *horizontal* space between check
boxes?
CanShrink only applies to vertical space.

There is no way to have the check boxes move to the left, unless you
write
code in the Format event of the (Detail?) section, to examine each field
and
set the Left property of the ones to the right.

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

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

message
ok, let me try to explain...in my report I have check boxes that I
would
like
displayed when there is a check, but what I don't want is for it to be
floating in the original location with all of this blank space in the
unchecked locations. In other words, if I have 10 check marks in a
column
and 3 of them are checked (in any order), I would only like to display
only
three in the space that only three check boxes can fit.

:

If a text box value is Null and its Can Shrink property is set to Yes,
it
will shrink. What makes you think the text box doesn't shrink? Try
display
the border to determine for sure if the control shrinks and your
problem
is
something else.

--
Duane Hookom
MS Access MVP

in
message ok, it does suppress it however it now it leaves blank spaces....I
even
changed the detail of the report & the text Box to can shrink....any
thoughts?

:

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

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

"Please help James" <[email protected]>
wrote
in
message
In the detail section of the report I have a label and the
corresponding
data...how do I suppress the label if the data field is blank?
 
G

Guest

Allen, when I type the expression for the check box, I get a "syntax error
(missing operator) in Query expression IIf([Notifications Incoming Wires]=
"No", "X", Null) any suggestions?

Allen Browne said:
Are these check boxes bound to a Yes/No field?

If so, the value will not be Null, and so they will not shrink.
You could try using a text box bound to an expression in place of the check
box.

If the check box field is named Field1, add a text box to your report, and
set these properties:
Control Source =IIf([Field1]= True, "X", Null)
Can Shrink Yes
Name txtForField1

Now right-click the attached label of this text box, and:
Change To | Text Box
Set the ControlSource of this text box to:
=IIf([txtForField1] Is Null, Null, "Field 1")

This text box and its label can now shrink vertically.

Once you have that working, you can change the X into a check mark character
if you want. Set the font for this text box to Wingdings, and replace the X
(inside the quotes) with a character that you generate by holding down thw
Alt key while typing 0254 on the numeric keypad. Use 0252 if you want an
unboxed check mark.

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

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

message
Allen, getting rid of the horizonal space would be nice, however I'd be
more
that happy to get rid of the Vertical space first. And for some reason
with
check boxes the detail does not shrink, leaving the three check boxes one
after the other...instead the three boxes are displayed with empty space
in
the location that the unchecked boxes would otherwise be.



Allen Browne said:
So you are trying to get rid of the *horizontal* space between check
boxes?
CanShrink only applies to vertical space.

There is no way to have the check boxes move to the left, unless you
write
code in the Format event of the (Detail?) section, to examine each field
and
set the Left property of the ones to the right.

message
ok, let me try to explain...in my report I have check boxes that I
would
like
displayed when there is a check, but what I don't want is for it to be
floating in the original location with all of this blank space in the
unchecked locations. In other words, if I have 10 check marks in a
column
and 3 of them are checked (in any order), I would only like to display
only
three in the space that only three check boxes can fit.

:

If a text box value is Null and its Can Shrink property is set to Yes,
it
will shrink. What makes you think the text box doesn't shrink? Try
display
the border to determine for sure if the control shrinks and your
problem
is
something else.

--
Duane Hookom
MS Access MVP

in
message ok, it does suppress it however it now it leaves blank spaces....I
even
changed the detail of the report & the text Box to can shrink....any
thoughts?

:

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

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

"Please help James" <[email protected]>
wrote
in
message
In the detail section of the report I have a label and the
corresponding
data...how do I suppress the label if the data field is blank?
 
G

Guest

Allen, I did everything you indicated and I still get blank lines whenever
something is supressed....any thoughts on what i can do to get rid of those
lines?

Duane Hookom said:
You might want to visit Allen's web page
http://www.allenbrowne.com/ser-52.html which swaps a check box for a text
box. You can set the control source to something like:
=IIf([YesNoField] = True, {Alt+0254},Null)
You have to enter the Alt+0254 as per his description.

--
Duane Hookom
MS Access MVP


Please help James said:
Allen, getting rid of the horizonal space would be nice, however I'd be
more
that happy to get rid of the Vertical space first. And for some reason
with
check boxes the detail does not shrink, leaving the three check boxes one
after the other...instead the three boxes are displayed with empty space
in
the location that the unchecked boxes would otherwise be.



Allen Browne said:
So you are trying to get rid of the *horizontal* space between check
boxes?
CanShrink only applies to vertical space.

There is no way to have the check boxes move to the left, unless you
write
code in the Format event of the (Detail?) section, to examine each field
and
set the Left property of the ones to the right.

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

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

message
ok, let me try to explain...in my report I have check boxes that I
would
like
displayed when there is a check, but what I don't want is for it to be
floating in the original location with all of this blank space in the
unchecked locations. In other words, if I have 10 check marks in a
column
and 3 of them are checked (in any order), I would only like to display
only
three in the space that only three check boxes can fit.

:

If a text box value is Null and its Can Shrink property is set to Yes,
it
will shrink. What makes you think the text box doesn't shrink? Try
display
the border to determine for sure if the control shrinks and your
problem
is
something else.

--
Duane Hookom
MS Access MVP

in
message ok, it does suppress it however it now it leaves blank spaces....I
even
changed the detail of the report & the text Box to can shrink....any
thoughts?

:

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

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

"Please help James" <[email protected]>
wrote
in
message
In the detail section of the report I have a label and the
corresponding
data...how do I suppress the label if the data field is blank?
 
A

Allen Browne

Query?
The expression was meant to go into the Control Source of a text box.
It must start with "=".
And drop the quotes around "No".

So:
=IIf([Notifications Incoming Wires]= No, "X", Null)

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

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

message
Allen, when I type the expression for the check box, I get a "syntax error
(missing operator) in Query expression IIf([Notifications Incoming Wires]=
"No", "X", Null) any suggestions?

Allen Browne said:
Are these check boxes bound to a Yes/No field?

If so, the value will not be Null, and so they will not shrink.
You could try using a text box bound to an expression in place of the
check
box.

If the check box field is named Field1, add a text box to your report,
and
set these properties:
Control Source =IIf([Field1]= True, "X", Null)
Can Shrink Yes
Name txtForField1

Now right-click the attached label of this text box, and:
Change To | Text Box
Set the ControlSource of this text box to:
=IIf([txtForField1] Is Null, Null, "Field 1")

This text box and its label can now shrink vertically.

Once you have that working, you can change the X into a check mark
character
if you want. Set the font for this text box to Wingdings, and replace the
X
(inside the quotes) with a character that you generate by holding down
thw
Alt key while typing 0254 on the numeric keypad. Use 0252 if you want an
unboxed check mark.

message
Allen, getting rid of the horizonal space would be nice, however I'd be
more
that happy to get rid of the Vertical space first. And for some reason
with
check boxes the detail does not shrink, leaving the three check boxes
one
after the other...instead the three boxes are displayed with empty
space
in
the location that the unchecked boxes would otherwise be.



:

So you are trying to get rid of the *horizontal* space between check
boxes?
CanShrink only applies to vertical space.

There is no way to have the check boxes move to the left, unless you
write
code in the Format event of the (Detail?) section, to examine each
field
and
set the Left property of the ones to the right.

in
message
ok, let me try to explain...in my report I have check boxes that I
would
like
displayed when there is a check, but what I don't want is for it to
be
floating in the original location with all of this blank space in
the
unchecked locations. In other words, if I have 10 check marks in a
column
and 3 of them are checked (in any order), I would only like to
display
only
three in the space that only three check boxes can fit.

:

If a text box value is Null and its Can Shrink property is set to
Yes,
it
will shrink. What makes you think the text box doesn't shrink? Try
display
the border to determine for sure if the control shrinks and your
problem
is
something else.

--
Duane Hookom
MS Access MVP

"Please help James" <[email protected]>
wrote
in
message ok, it does suppress it however it now it leaves blank
spaces....I
even
changed the detail of the report & the text Box to can
shrink....any
thoughts?

:

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

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

"Please help James" <[email protected]>
wrote
in
message
In the detail section of the report I have a label and the
corresponding
data...how do I suppress the label if the data field is blank?
 
G

Guest

Allen, the only step that was missing was that I can't have any spaces
between each text box...not even a little space, each field needs to touch
the one prior in order to work. Thanks for all of your help....you enabled
me to understand the relationship of how the check box, text box and the
shrink funtion work together. Thanks again!

Allen Browne said:
Query?
The expression was meant to go into the Control Source of a text box.
It must start with "=".
And drop the quotes around "No".

So:
=IIf([Notifications Incoming Wires]= No, "X", Null)

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

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

message
Allen, when I type the expression for the check box, I get a "syntax error
(missing operator) in Query expression IIf([Notifications Incoming Wires]=
"No", "X", Null) any suggestions?

Allen Browne said:
Are these check boxes bound to a Yes/No field?

If so, the value will not be Null, and so they will not shrink.
You could try using a text box bound to an expression in place of the
check
box.

If the check box field is named Field1, add a text box to your report,
and
set these properties:
Control Source =IIf([Field1]= True, "X", Null)
Can Shrink Yes
Name txtForField1

Now right-click the attached label of this text box, and:
Change To | Text Box
Set the ControlSource of this text box to:
=IIf([txtForField1] Is Null, Null, "Field 1")

This text box and its label can now shrink vertically.

Once you have that working, you can change the X into a check mark
character
if you want. Set the font for this text box to Wingdings, and replace the
X
(inside the quotes) with a character that you generate by holding down
thw
Alt key while typing 0254 on the numeric keypad. Use 0252 if you want an
unboxed check mark.

message
Allen, getting rid of the horizonal space would be nice, however I'd be
more
that happy to get rid of the Vertical space first. And for some reason
with
check boxes the detail does not shrink, leaving the three check boxes
one
after the other...instead the three boxes are displayed with empty
space
in
the location that the unchecked boxes would otherwise be.



:

So you are trying to get rid of the *horizontal* space between check
boxes?
CanShrink only applies to vertical space.

There is no way to have the check boxes move to the left, unless you
write
code in the Format event of the (Detail?) section, to examine each
field
and
set the Left property of the ones to the right.

in
message
ok, let me try to explain...in my report I have check boxes that I
would
like
displayed when there is a check, but what I don't want is for it to
be
floating in the original location with all of this blank space in
the
unchecked locations. In other words, if I have 10 check marks in a
column
and 3 of them are checked (in any order), I would only like to
display
only
three in the space that only three check boxes can fit.

:

If a text box value is Null and its Can Shrink property is set to
Yes,
it
will shrink. What makes you think the text box doesn't shrink? Try
display
the border to determine for sure if the control shrinks and your
problem
is
something else.

--
Duane Hookom
MS Access MVP

"Please help James" <[email protected]>
wrote
in
message ok, it does suppress it however it now it leaves blank
spaces....I
even
changed the detail of the report & the text Box to can
shrink....any
thoughts?

:

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

Set the Control Source of this text box to something like this:
=IIf([MyField] Is Null, Null, "MyField:")
putting your field name in place of MyField.

"Please help James" <[email protected]>
wrote
in
message
In the detail section of the report I have a label and the
corresponding
data...how do I suppress the label if the data field is blank?
 

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