visible label based on text value

  • Follow


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
-- 
thanks as always for the help
 jer
0
Reply Utf 3/27/2010 5:29:02 PM

jer wrote:

>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, "")))
> 0)

-- 
Marsh
MVP [MS Access]
0
Reply Marshall 3/27/2010 6:14:32 PM


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





-- 
thanks as always for the help
 jer

"Marshall Barton" wrote:

> jer wrote:
> 
> >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, "")))
> > 0)
> 
> -- 
> Marsh
> MVP [MS Access]
> .
> 
0
Reply Utf 3/27/2010 8:42:01 PM

jer wrote:
>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.

-- 
Marsh
MVP [MS Access]
0
Reply Marshall 3/27/2010 9:50:31 PM

3 Replies
887 Views

(page loaded in 0.033 seconds)

Similiar Articles:
















7/25/2012 1:33:39 PM


Reply: