Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / December 2006

Tip: Looking for answers? Try searching our database.

Hide a label

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nirie1 - 13 Dec 2006 21:50 GMT
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
putting in =llf([Noncompliant Materials] Is Null,Null,"Noncompliant
BOM")

I get error.

I dont have any idea how to put code into a report. I want the label to
show when the attached field has text. I turned on grow and shrink but
of course that doesnt affect the label just the field. I saw several
posts already with this topic which is how I got the above but it
doesnt seem to work for me.

NonCompliant Materials is the name of my field. I want the label to
sahave an abbreviation what the field is so it can fit better on the
report. Thanks for any help!
fredg - 13 Dec 2006 22:20 GMT
> 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

Jeff Boyce - 14 Dec 2006 00:40 GMT
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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.