Results 1 to 4 of 4

Thread: Access 2007: Using CanShrink and CanGrow to get rid of extra spaces

  1. #1
    Join Date
    Apr 2013
    Location
    Laurel, MD
    Posts
    27

    Access 2007: Using CanShrink and CanGrow to get rid of extra spaces

    Afternoon all,

    I am using Access 2007 and I am trying to get rid of extra spaces when there is no data to display on my report. I created a database that is used as a phone directory. I set the report to display two columns: one for the local information and the other for the corporate info. I have created unbound text boxes to display the info and an IF/ELSE statement if fields are blank. Since it is in two columns, when I expend the unbound text box on the corporate side to display all the info it also expends on the local side and gives me blank spaces. I have set the 'can shrink' and 'can grow' properties to 'Yes' on the property sheet but that didn't do anything.

    All the information entered under the corporate section on the right is what is giving me the extra spacing on the left side. So I need to find a way to get rid of the spaces that are under 'Samantha Smith' and shift every thing up.

    I have tried to set the height of the 'Details' section to 1, but it won't let me do it as the unbound text box for the corporate information is large. And if I make that smaller then I loose data. as some of the fields will be cut off.

    I can email screen shots if needed. I have 4 files of aproximately 200.00 KB each and they are too big for attaching.

    Thanks for the help.

  2. #2
    Join Date
    May 2006
    Posts
    407
    As I remember, an unbound text box does not shrink or grow. In order to use shrink or grow you need to use a bound text box.

  3. #3
    Join Date
    Apr 2013
    Location
    Laurel, MD
    Posts
    27
    Ok. Thanks. I will see if that works and get back to you.

  4. #4
    Join Date
    Apr 2013
    Location
    Laurel, MD
    Posts
    27
    I was able to shrink part of the data (the left side of the report which contains the corporate info) in my unbound text box using an If Not-Then-Else Statement. But for some reason I am unaible to apply the same statement to my right side of the report (which contains the local info). Every time I do everything just disappears.

    This is the code I used for the corporate info:

    Me.Text71 = Me.[CyCorpNam] & vbCrLf & Me.[CorpAdrSt] & vbCrLf & Me.[CorpAdrSteNb] & vbCrLf & Me.[CorpAdrCity] & " " & Me.[CorpAdrStat] & " " & Me.[CorpAdrZip] & vbCrLf & Me.[CorpoFax] & vbCrLf & [CorpEmplFirNam] & " " & Me.[CorpEmplLasNam] & " " & Me.[CorpEmplTitl] & vbCrLf & Me.[CorpEmplPho] & vbCrLf & Me.[CorpEmplEmail]
    Me.Text71 = ""

    If Not IsNull(Me.[CyCorpNam]) Then
    Me.Text71 = Me.[CyCorpNam]
    End If
    If Not IsNull(Me.[CorpAdrSt]) Then
    Me.Text71 = Me.Text71 & vbCrLf & Me.[CorpAdrSt]
    End If
    If Not IsNull(Me.[CorpAdrSteNb]) Then
    Me.Text71 = Me.Text71 & vbCrLf & Me.[CorpAdrSteNb]
    End If
    If Not IsNull(Me.[CorpAdrCity]) Then
    Me.Text71 = Me.Text71 & vbCrLf & Me.[CorpAdrCity]
    End If
    If Not IsNull(Me.[CorpAdrStat]) Then
    Me.Text71 = Me.Text71 & "," & Me.[CorpAdrStat]
    End If
    If Not IsNull(Me.[CorpAdrZip]) Then
    Me.Text71 = Me.Text71 & " " & Me.[CorpAdrZip]
    End If
    If Not IsNull(Me.[CorpoFax]) Then
    Me.Text71 = Me.Text71 & vbCrLf & Me.[CorpoFax]
    End If
    If Not IsNull(Me.[CorpEmplFirNam]) Then
    Me.Text71 = Me.Text71 & vbCrLf & vbCrLf & Me.[CorpEmplFirNam]
    End If
    If Not IsNull(Me.[CorpEmplLasNam]) Then
    Me.Text71 = Me.Text71 & " " & Me.[CorpEmplLasNam]
    End If
    If Not IsNull(Me.[CorpEmplTitl]) Then
    Me.Text71 = Me.Text71 & "," & " " & Me.[CorpEmplTitl]
    End If
    If Not IsNull(Me.[CorpEmplPho]) Then
    Me.Text71 = Me.Text71 & vbCrLf & Me.[CorpEmplPho]
    End If
    If Not IsNull(Me.[CorpEmplEmail]) Then
    Me.Text71 = Me.Text71 & vbCrLf & Me.[CorpEmplEmail]
    End If

    If IsNull(Me.[CorpEmplEmail]) Then
    Me.Label44.Visible = False
    Else
    Me.Label44.Visible = True
    End If

    If IsNull(Me.[CorpPho]) Then
    Me.Label47.Visible = False
    Else
    Me.Label47.Visible = True
    End If

    If IsNull(Me.[CorpoFax]) Then
    Me.Label48.Visible = False
    Else
    Me.Label48.Visible = True
    End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •