PC Review


Reply
Thread Tools Rate Thread

How do I hide fields that have no data when printing report

 
 
Stacie
Guest
Posts: n/a
 
      17th Nov 2008
I am trying to print a directory and have some entires that have many
fields/data and others where that specific info is not available. How can I
hide those fields that have no info available for some but print when the
info is present?
 
Reply With Quote
 
 
 
 
George
Guest
Posts: n/a
 
      17th Nov 2008
Hi Stacie,

I am not sure if I understood well what you need to do, but I will try:

If you need to print a report and show only those records having something
recorded in some fields then use a query in order to filter those records,
and use it a record source in your report, e.g.

SELECT YourTableName.Field1, YourTableName.Filed2, YourTableName.Field3
FROM T_Rents
WHERE (((YourTableName.Field1) Is Not Null) AND ((YourTableName.Field2) Is
Not Null)) OR (((YourTableName.Field3) Is Not Null));

The result of the above will show:

All records having something recorded in field1 and field2 (both of them not
being null) and also those (the Or condition) records having something
recorded in field3.

Any further advise will be followed if needed.

Regards,

GeorgeCY




Ο χρήστης "Stacie" *γγραψε:

> I am trying to print a directory and have some entires that have many
> fields/data and others where that specific info is not available. How can I
> hide those fields that have no info available for some but print when the
> info is present?

 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      17th Nov 2008
In the report, set the section's can shrink property to yes.
Set each control's can shrink property to yes.

Labels don't shrink so if you have labels in the section, you will need to add
VBA code to set the label's visible property to No when the associated control
is null.

In the format event of the section you would have code like

Me.Address2Label.Visible = Not(IsNull(Me.Address2))
Me.EmailLabel.Visible = Not(IsNull(Me.Email))

Another option to handle labels is to incorporate the label caption into the
the associated control and delete the label. The control's source would become:
="EMail: " + [Email]
If you use this approach, you will have to ensure that the control's name is
NOT Email, but something like txtEmail. In other words, the control's name
cannot be the same as any field you are using.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

Stacie wrote:
> I am trying to print a directory and have some entires that have many
> fields/data and others where that specific info is not available. How can I
> hide those fields that have no info available for some but print when the
> info is present?

 
Reply With Quote
 
Stacie
Guest
Posts: n/a
 
      26th Nov 2008
Thanks. I was able to hide the labels. However, although this report is
based on a query the fields that I am wanting to hide when empty are straight
address and email fields. Do I need specific instructions in the query to
achieve my desired outcome?

stacie

"John Spencer" wrote:

> In the report, set the section's can shrink property to yes.
> Set each control's can shrink property to yes.
>
> Labels don't shrink so if you have labels in the section, you will need to add
> VBA code to set the label's visible property to No when the associated control
> is null.
>
> In the format event of the section you would have code like
>
> Me.Address2Label.Visible = Not(IsNull(Me.Address2))
> Me.EmailLabel.Visible = Not(IsNull(Me.Email))
>
> Another option to handle labels is to incorporate the label caption into the
> the associated control and delete the label. The control's source would become:
> ="EMail: " + [Email]
> If you use this approach, you will have to ensure that the control's name is
> NOT Email, but something like txtEmail. In other words, the control's name
> cannot be the same as any field you are using.
>
> John Spencer
> Access MVP 2002-2005, 2007-2008
> The Hilltop Institute
> University of Maryland Baltimore County
>
> Stacie wrote:
> > I am trying to print a directory and have some entires that have many
> > fields/data and others where that specific info is not available. How can I
> > hide those fields that have no info available for some but print when the
> > info is present?

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert text fields to numeric fields without losing data in text fields. Frank Microsoft Access Form Coding 24 19th Jan 2008 12:22 PM
How to hide and un-hide fields upon condition p-rat Microsoft Access Form Coding 2 14th Jan 2008 08:46 PM
Specify which rows to NOT hide, and have excel hide the rest =?Utf-8?B?TW8y?= Microsoft Excel Programming 0 25th Apr 2007 03:44 AM
Automatically add/show/hide rows that have (or have no) data? wx4usa@gmail.com Microsoft Excel Programming 0 28th Dec 2006 05:17 PM
Printing only fields that have a value on report Alcide LaVassar Microsoft Access Reports 1 8th Oct 2003 10:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:44 AM.