check box label to be visible and invisible

G

Guest

I have a text box named Label220 with the control source:
="Inactive Date "+IIf(IsNull([InactiveCheck] & [InactiveDate]),Null,"")

[InactiveCheck] is a check box and [InactiveDate] is a text box. When the
report is executed Label220 appears even when [InactiveCheck] has no value.

Is Label220 appearing because [InactiveCheck] is a check box and this
clashes somehow with the code? How can I correct this?

Thanks for your help!
 
G

Guest

Hi John,
I'm assuming that when the check box is true you want the label shown etc if
so what about trying the following in the checkbox update

If InactiveCheck = True then
InactiveDate.visible = True
Elseif InactiveCheck = False Then
InactiveDate.visible = False
End if

Cheers
 
A

Allen Browne

If InactiveCheck is a bound to a Yes/No field in your table, it will never
be Null.

Post a reply, John, if that's not the issue.
 
G

Guest

Thanks, Wuelf. Yes - I want the label to show only when there is a value in
the checkbox, however, what Allen posted regarding the box being linked to a
Yes/No field comes into play as this is the case and therefore, the field
will never have a null value. I've asked Allen if this can be worked around.

Thanks, again!

--
www.Marzetti.com


Wuelf said:
Hi John,
I'm assuming that when the check box is true you want the label shown etc if
so what about trying the following in the checkbox update

If InactiveCheck = True then
InactiveDate.visible = True
Elseif InactiveCheck = False Then
InactiveDate.visible = False
End if

Cheers

JohnLute said:
I have a text box named Label220 with the control source:
="Inactive Date "+IIf(IsNull([InactiveCheck] & [InactiveDate]),Null,"")

[InactiveCheck] is a check box and [InactiveDate] is a text box. When the
report is executed Label220 appears even when [InactiveCheck] has no value.

Is Label220 appearing because [InactiveCheck] is a check box and this
clashes somehow with the code? How can I correct this?

Thanks for your help!
 
A

Allen Browne

John, I didn't see your reply yet, but perhaps:
=IIf([InactiveCheck], "Inactive Date " + [InactiveDate], Null)
 
G

Guest

Hi, Allen. Yes - it's bound to a Yes/No field. Is there any way around this?

Thanks!

--
www.Marzetti.com


Allen Browne said:
If InactiveCheck is a bound to a Yes/No field in your table, it will never
be Null.

Post a reply, John, if that's not the issue.

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

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

JohnLute said:
I have a text box named Label220 with the control source:
="Inactive Date "+IIf(IsNull([InactiveCheck] & [InactiveDate]),Null,"")

[InactiveCheck] is a check box and [InactiveDate] is a text box. When the
report is executed Label220 appears even when [InactiveCheck] has no
value.

Is Label220 appearing because [InactiveCheck] is a check box and this
clashes somehow with the code? How can I correct this?

Thanks for your help!
 
G

Guest

Thanks, Allen. This returns the field data but the label doesn't appear.

???

--
www.Marzetti.com


Allen Browne said:
John, I didn't see your reply yet, but perhaps:
=IIf([InactiveCheck], "Inactive Date " + [InactiveDate], Null)

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

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

JohnLute said:
Thanks, Wuelf. Yes - I want the label to show only when there is a value
in
the checkbox, however, what Allen posted regarding the box being linked to
a
Yes/No field comes into play as this is the case and therefore, the field
will never have a null value. I've asked Allen if this can be worked
around.
 
A

Allen Browne

Let's see if I understand your aim, here John.

Label220 is a text box.

If the yes/no field named InactiveCheck is True, you want to see:
Inactive Date 1/1/2005

If InactiveCheck is False, you want Label220 to be null.

Try:
=Iff([InactiveCheck], "Inactive Date " & [InactiveDate], Null)

If I have not understood you, please clarify for me.
 
G

Guest

Thanks, Allen.

I think I'll simplify and refocus my aim. I need to create a label for
[InactiveCheck] only.

I think I was trying to make one text box do too much. I modified your code:
=IIf([InactiveCheck], "Inactive Date ", Null)

That works fine.

Thanks for all your help!!!

--
www.Marzetti.com


Allen Browne said:
Let's see if I understand your aim, here John.

Label220 is a text box.

If the yes/no field named InactiveCheck is True, you want to see:
Inactive Date 1/1/2005

If InactiveCheck is False, you want Label220 to be null.

Try:
=Iff([InactiveCheck], "Inactive Date " & [InactiveDate], Null)

If I have not understood you, please clarify for me.

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

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

JohnLute said:
Thanks, Allen. This returns the field data but the label doesn't appear.

???
 

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