visible label based on text value

J

jer

I am using a database on a LAN and I have the following in the on format event
Me.ContactList.Visible = Not IsNull(Me.ContactList)
However when one user opens the data base the label is hidden if the
condition is true but if another user on the LAN subsequently accesses the
data base all the labels are displayed
any suggestions
 
M

Marshall Barton

jer said:
I am using a database on a LAN and I have the following in the on format event
Me.ContactList.Visible = Not IsNull(Me.ContactList)
However when one user opens the data base the label is hidden if the
condition is true but if another user on the LAN subsequently accesses the
data base all the labels are displayed


The only thing I can think of is to verify that the control
value is really Null. Maybe it's a zero length string? or
maybe it's one or more spaces.

If that's what's happening, you should think about why you
set the table field's AllowZeroLength property to Yes. If
it were set to No, it would be Null instead.

If you can not prevent the field from containing a ZLS, try
checking for both Null and ZLS:

Me.ContactList.Visible = (Len(Nz(Me.ContactList, "")) > 0)

If the value somehow got set to one or more spaces, then use
the Trim function to get rid of them:

Me.ContactList.Visible = (Len(Trin(Nz(Me.ContactList, "")))
 
J

jer

Thank you Marshall for the quick response. On closer review I am noticing
something else which is not consistent I supplied one of a number of labels
which are in a group header. In order to format the report to fit on a letter
size page, I have three rows of headers and 3 rows of details, e.g.,
Header= Type

Type1
label1 label2 label3
label4 label 6

detail1 detail2 detail3
detail4 detail6

Type2
label1 label2 label3
label5

detail1 detail2 detail3
detail5

I notice that the labels are not always matching the details. e.g label 5
for type2 is not visible even though there are details under this header
any other suggestions
 
M

Marshall Barton

jer said:
Thank you Marshall for the quick response. On closer review I am noticing
something else which is not consistent I supplied one of a number of labels
which are in a group header. In order to format the report to fit on a letter
size page, I have three rows of headers and 3 rows of details, e.g.,
Header= Type

Type1
label1 label2 label3
label4 label 6

detail1 detail2 detail3
detail4 detail6

Type2
label1 label2 label3
label5

detail1 detail2 detail3
detail5

I notice that the labels are not always matching the details. e.g label 5
for type2 is not visible even though there are details under this header
any other suggestions


I'd be willing to bet that what you are seeing is
consistent. It's just not meeting your expectations and we
have yet to figured out why.

OTOH, your statements in this post do seem incinsistent to
me. You said you have 3 rows of headers and 3 rows of
details, but your example has two rows with 3 columns. How
are you doing that? Is the report set up to use 3 columns?
If it's not using 3 columns, how are the details arranged to
get 3 details per row?

Is it true that each type grouping only has one detail
record?

Did you verify that no record has a ZLS or spaces in the
field?

Aother stray thought. Verify that your code is in the
detail section's Format event.
 

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