Results 1 to 5 of 5
  1. #1
    kiri19 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Location
    Ottawa, Canada
    Posts
    18

    Shrink space occupied by a control on main form when it is hidden.

    I am trying to shrink the space occupied by a subform when it is hidden, is there a way to use the height of the subform in centimeters from the property sheet/format tab.
    Also this code below does not seem to change anything.



    Private Sub Form_Current()
    If IsNull(Me.[Client ID].Value) = True Then

    Me.visitsdatasheetform.Visible = False
    Me.visitsdatasheetform.height = 0
    Docmd.MoveSize , , , Me.InsideHeight = -10000

    Else

    Me.visitsdatasheetform.Visible = True
    Me.visitsdatasheetform.Height = 10000
    DoCmd.MoveSize , , , Me.InsideHeight + 10000

    End If
    End Sub

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Why do you need to do this on a form? Why is this important?

    The first MoveSize syntax looks wrong. Remove the equal sign.

    Step debug, follow the code as it executes. Refer to link at bottom of my post for debug techniques.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    kiri19 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Location
    Ottawa, Canada
    Posts
    18
    i am trying to have a subform appear only when the "Cliend ID "has been created, i have removed the = sign and it works only for the subform, but the white space does not go when the subform is hidden.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Probably have to reduce the size of the section the subform sits in. Is it in Detail section? Detail section has CanGrow and CanShrink properties.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    kiri19 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Location
    Ottawa, Canada
    Posts
    18
    i gave up on this idea..i did something else easier. Thanks

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

Similar Threads

  1. Replies: 3
    Last Post: 03-29-2012, 12:40 PM
  2. Replies: 2
    Last Post: 03-01-2011, 03:06 PM
  3. Subform in a Tab Control on a Main form
    By jpkeller55 in forum Access
    Replies: 4
    Last Post: 01-08-2011, 12:31 PM
  4. Help - activate hidden control
    By Belxaviar1973 in forum Forms
    Replies: 2
    Last Post: 08-31-2010, 09:20 AM
  5. Can Shrink control
    By fojcenter in forum Forms
    Replies: 1
    Last Post: 02-25-2010, 03:49 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