Results 1 to 5 of 5
  1. #1
    SusanCoder is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Mar 2016
    Posts
    34

    shrink white space when object set to not visible

    Access 2010. I have a simple form with a header and detail section. In the detail section are three labels, on top of each other but not touching. On opening the form, the Visible property for the labels is set to "yes". On the form under the labels is a button. When the button is selected, it runs an event proc to set Label One to "not visible". All works great so far.



    I'd like the white space where Label One was to go away, so it looks like Label Two is at the top of the form.

    I've tried setting Can Shrink and Can Grow to "yes" in the Detail section property sheet, but so far no luck. Do I need to refresh the form or something else?

    Thanks for your help.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    can grow/shrink is only applicable when printing a form. Not sure what white space you are referring to unless the detail section backcolor is white.

    It sounds like what you are trying to do is reposition label2 where label1 is? If so then code to move label2 (and 3?) would be something like this

    me.label2.top=me.label1.top

    ensure label 2 is 'in front' of label 1 otherwise it will be hidden behind label1 (or also include your code to hide label1)

  3. #3
    SusanCoder is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2016
    Posts
    34
    Thanks, Ajax. I tried your suggestion but it didn't have any effect on the space where the first label was. The space blank remained after the object (label) was hidden. Here is my code on the button's event proc. The name of my labels are lblIntroPara1, lblIntroPara2, and lblIntroPara3.

    Code:
    Private Sub btnNextPageIntro_Click()
        Me.lblIntroPara1.Visible = False
        Me.lblIntroPara1.Top = Me.lblIntroPara2.Top
    End Sub

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    perhaps send a screenshot of the form, I'm struggling to understand what you mean

    and this

    Me.lblIntroPara1.Top = Me.lblIntroPara2.Top

    should be

    Me.lblIntroPara2.Top = Me.lblIntroPara1.Top

  5. #5
    SusanCoder is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2016
    Posts
    34
    Ah. What a difference a transposed "1" and "2" can make. It worked when I switched the label names on the .top equation.

    Thanks, Ajax!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Remove white space around a Chart object
    By destino in forum Reports
    Replies: 5
    Last Post: 01-29-2021, 10:26 AM
  2. Replies: 4
    Last Post: 09-19-2012, 08:44 AM
  3. White Space on Report
    By vansicklej in forum Reports
    Replies: 4
    Last Post: 07-31-2012, 12:00 PM
  4. Complicated white space question
    By raytackettsells in forum Access
    Replies: 12
    Last Post: 03-19-2012, 05:14 PM
  5. Remove White Space
    By jsimard in forum Reports
    Replies: 3
    Last Post: 01-24-2012, 12:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums