Suppress a label

R

Ralph

I want to suppress the printing of a label if the
corresponding field is empty "". The detail is set to can
shrink.

For example:

In a course listing, if a course has prerequisites, the
prerequisite label will print. However, if there are no
prerequisites, no label will print and neither should the
field and the detail will shrink.
 
M

Marshall Barton

Ralph said:
I want to suppress the printing of a label if the
corresponding field is empty "". The detail is set to can
shrink.

For example:

In a course listing, if a course has prerequisites, the
prerequisite label will print. However, if there are no
prerequisites, no label will print and neither should the
field and the detail will shrink.


I prefer to use a line of code in the detail section's
Format event:

Me.label.Visible = Not IsNull(Me.textbox)

If the label is attached to the text box, you can make the
text box invisible and its label will become invisible too:

Me.textbox.Visible = Not IsNull(Me.textbox)

If you really mean that the field contains a zero length
string instead of Null. then you can use this kind of
expression to chack for either case:

Me.textbox.Visible = (Nz(Me.textbox, "") <> "")
 

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