A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Not to print blank fields



 
 
Thread Tools Display Modes
  #1  
Old March 13th, 2007, 11:36 AM posted to microsoft.public.access.reports
Agent Ting
external usenet poster
 
Posts: 7
Default Not to print blank fields

Hi all,

I have in my designed report 5 fields, say Note1, Note2 and so on.
Sometimes not all fields are filled in, hence I have a problem trying to NOT
print the fields that are empty, as it always crosses another page showing
nothing.

Does anyone how a code could help to do this?

Many thanks.
  #2  
Old March 13th, 2007, 12:02 PM posted to microsoft.public.access.reports
Rick B
external usenet poster
 
Posts: 749
Default Not to print blank fields

Well, typically if you have up to five entries for an item, and each entry
is interchangeable, you would not create five fields for it. This is called
a one-to-many relationship. Instead, you create a separate related table
where the user can add one or more records. For example, lets say that you
can enter one or more notes per "customer". You'd have a customer table,
and a notes table. You'd have one record per customer in the customer
table, and one or more records per customer in the NOTES table. The two
tables would be related through the use of the customer number field...

TblCustomers
CustomerNumber
CustFirstName
CustLastName
CustAddress1
CustAddress2
CustCity
CustState
CustZIP
etc.


TblNotes
CustNumber
NoteDate
NoteText


Once you "normalize" your database, you will find it much easier to produce
queries, forms, and reports without having to jump through hoops to get it
to format the way you want.

Hope that helps.


--
Rick B



"Agent Ting" wrote in message
news
Hi all,

I have in my designed report 5 fields, say Note1, Note2 and so on.
Sometimes not all fields are filled in, hence I have a problem trying to
NOT
print the fields that are empty, as it always crosses another page showing
nothing.

Does anyone how a code could help to do this?

Many thanks.



  #3  
Old March 13th, 2007, 12:09 PM posted to microsoft.public.access.reports
BruceM
external usenet poster
 
Posts: 723
Default Not to print blank fields

Try setting the Can Grow and Can Shrink property of the text boxes and of
the Detail section (if that is where the text boxes are located) to Yes, and
make the text boxes tall enough for one row of text. If the text boxes are
side by side, or if there are other text boxes to the left or right, this
may not work as expected, as the text boxes to either side will grow whether
you mean them to or not.
An option if the above does not work is to concatenate the text. In the
Detail section you could have a text box named txtNotes; in the Detail
section's Print event, you could then have something like:
Me.txtNotes = [Note1] & (vbCrLf + [Note2]) & (vbCrLf + [Note3])
vbCrLf takes you to the next line (carriage return and line feed). By using
the plus sign, if any part of the expression within parentheses is null the
entire expression within the parentheses evaluates to null. For instance,
if Note2 is null, the code skips to Note3 without leaving a blank line.

"Agent Ting" wrote in message
news
Hi all,

I have in my designed report 5 fields, say Note1, Note2 and so on.
Sometimes not all fields are filled in, hence I have a problem trying to
NOT
print the fields that are empty, as it always crosses another page showing
nothing.

Does anyone how a code could help to do this?

Many thanks.



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.