Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-03-13
4
Medium Priority
?
1,926 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
  • 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 2000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

926 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