Solved

How do I remove blank lines in Access reports with CanShrink function?

Posted on 2011-03-13
4
1,833 Views
Last Modified: 2012-06-22
Hello there,

  We have been having a lot of trouble implementing a CanShrink function into an Access database of names and addresses.  Despite repeated attempts we are getting blank lines showing up in the reports where the information is missing, even though we have tried to stop the problem with a limiting IFNULL and a CanShrink function.

  We would like to have a clean Report come out of the database which has no blanks in the displayed info.  (except of course for the spacing between each record).

  Hopefully in the file you will see where these blank lines are showing up - we just want them gone so that the information per person is tightened up.

  Is there a distinction between doing something like this in Access 2003 vs. 2010?  I am hoping not since the database needs to be used in both versions.

  I am totally lost in Access and even more-so with these functions.  Anyone out there able to solve this one?

  I am attaching the Access database file and a sample of the excel mailing list which contains the info (blank fields and all) which it is trying to organize.  The excel file is called "Annuaire 50 NAME TEST OF BLANKS", which I think is Sheet 1 in the database, and the access file is just db1.

  Feel free to insert the proper function/macro/if-statements/whatever-it-is-called in order to solve this one.  Honestly, I can't even locate where it is put in anymore or where to find it in Access.

I shall await patiently. Annuaire-50-NAME-TEST-OF-BLANKS.xls db1.mdb
0
Comment
Question by:jayxx2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35123418
try this function

Public Function CanShrinkLines(ParamArray arrLines())
' Pass this function the lines to be combined
' For example: strAddress =
' CanShrinkLines(Name, Address1, Address2, City, St, Zip, Country)
Dim x As Integer, strLine As String
  For x = 0 To UBound(arrLines)
  arrLines(x) = Trim(arrLines(x))    '<<< insert this line
    If Not IsNull(arrLines(x)) And arrLines(x) & "" <> "" Then  '<< revised line
      strLine = strLine & arrLines(x) & vbCrLf
    End If
  Next
  CanShrinkLines = strLine
End Function

Open in new window

0
 

Author Comment

by:jayxx2
ID: 35123522
I'd love to try it out - Can you give me some basic instructions on how/where to put it in?  

I have taken over this database problem from scratch and as mentioned in my original plea for help, have no idea where to even place it or run it.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 35123543
there is a function named "CanShrinkLines" located in module named MainModule

here is the revised db
db1rev.mdb
0
 

Author Closing Comment

by:jayxx2
ID: 35123628
My thanks for the prompt work!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question