Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

670 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