> I have tried several ways to hide the label in a report when the
> attached field is empty. I tried changing the field to a textbox and
[quoted text clipped - 12 lines]
> sahave an abbreviation what the field is so it can fit better on the
> report. Thanks for any help!
Use an unbound text control as the label (not a Label control):
=llf(IsNull([Noncompliant Materials]), "" ,"Noncompliant BOM")
should work.
You can also place the following code in the Detail Format event if
you wish to use the existing label:
Me![LabelName].Visible = Not IsNull([NonCompliant Materials])

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
When I have a label bound to a control that has Grow/Shrink turned on, if
the control has no data (null, not ""), then both the control and its label
"shrink".
Is there a chance that you added a "naked" control (no label), then added an
"orphan" label control (belongs to nothing), but never told the label
control that it belonged to the text (or whatever) control?
Regards
Jeff Boyce
Microsoft Office/Access MVP
>I have tried several ways to hide the label in a report when the
> attached field is empty. I tried changing the field to a textbox and
[quoted text clipped - 12 lines]
> sahave an abbreviation what the field is so it can fit better on the
> report. Thanks for any help!
Naeem Azizian - 14 Dec 2006 08:03 GMT
you need to put a code in the onformat event of your report:
If IsNull(Me.[Noncompliant Materials]) = True Then
Me.[Noncompliant Materials].Visible = False
Me.[lable Noncompliant Materials].Caption = ""
Me.[lable Noncompliant Materials].Visible = False
Else
Me.[Noncompliant Materials].Visible = True
Me.[Noncompliant Materials] = Me.[Noncompliant Materials]
Me.[lable Noncompliant Materials].Caption = "Non Compliant
Materials"
Me.[lable Noncompliant Materials].Visible = True
End If
hope this helps
> When I have a label bound to a control that has Grow/Shrink turned on, if
> the control has no data (null, not ""), then both the control and its label
[quoted text clipped - 25 lines]
> > sahave an abbreviation what the field is so it can fit better on the
> > report. Thanks for any help!
nirie1 - 14 Dec 2006 15:41 GMT
I went to view and clicked on Code then put in just what you wrote in
the window. The window had general on the left and declartions on the
right. I'm not even sure if I was in the right place
I got an error message.
> you need to put a code in the onformat event of your report:
>
[quoted text clipped - 41 lines]
> > > sahave an abbreviation what the field is so it can fit better on the
> > > report. Thanks for any help!
Naeem Azizian - 20 Dec 2006 03:34 GMT
Here is what you have to do:
Go to the report's Design View
Double click on the details area of the report to open Details
properties page. (you can also choose Details1 from Objects drop down
list from the menu and then click on the properties tab.)
in the properties tab you have a tab named 'Event' click on that.
There you must see On Format
click in the text box and then click on the ... next to it.
Choose Code Builder from the window that appears.
Here you must put that code.
notice that you may need to modify the code in order to make sure all
the control names are typed correctly.
hope this helps,
> I went to view and clicked on Code then put in just what you wrote in
> the window. The window had general on the left and declartions on the
[quoted text clipped - 47 lines]
> > > > sahave an abbreviation what the field is so it can fit better on the
> > > > report. Thanks for any help!