Results 1 to 5 of 5
  1. #1
    eugzl is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2021
    Posts
    68

    how create collapse panel in form for field or group of fields

    Hi All.
    The form that I'm developing has field or group of fields which not necessary to display constantly. Is it possible to create collapse panel by way that if field or fields are hidden they will not occupy space on a form? If yes. How it to do?

    Thanks

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,281
    No, not possible. Unless you move them to some location that does not affect the other controls.?
    A lot of work, I would have thought?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    rather than hiding them, set their top and height properties to 0. It there are controls below this group, you can then move them up and then reset the section height (which just needs setting to 0 - form will then reduce section height to the lowest top+height value

  4. #4
    eugzl is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2021
    Posts
    68
    Hi Ajax. Thanks for reply.
    Very interesting idea. I will try. Just can show me how can I change height and width of form and control programmatically? For instance, in AfterUpdate event.
    Thanks

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    In vba your code might look like

    Ctlname.top=0
    Cltname.height=0


    Section(1).height =0

    Change the 1 for whatever section the controls are in (1 header, 2 footer, 0 detail)

    Put it in whatever event you are using to ‘hide’ the controls

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

Similar Threads

  1. Replies: 1
    Last Post: 10-31-2016, 05:00 AM
  2. Replies: 0
    Last Post: 09-01-2015, 12:20 PM
  3. Replies: 3
    Last Post: 07-10-2015, 08:28 AM
  4. Replies: 4
    Last Post: 05-29-2012, 01:32 PM
  5. Replies: 2
    Last Post: 01-31-2011, 05:17 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