Results 1 to 4 of 4

Access 2010 Hide/Show Fields In Subform Button

  1. #1
    accote is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    35

    Access 2010 Hide/Show Fields In Subform Button

    Hi Everyone, and thanks for any help you can provide.

    I have a main form with a datasheet subform, I know I can hide/unhide columns by right clicking
    on the columns in the subform, but would prefer to have a button on my main form that will do just
    that. How can I create a button that when clicked in the header of the main form will give me the
    options to hide or unhide available columns in the subform?

    Thanks

    accote

  2. #2
    June7's Avatar
    June7 is online now Moderator
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    28,530
    I tried this with subform in Datasheet view, didn't work, Continuous view does work.

    Options:

    1. checkbox
    Me.subformname.Form.textboxname.Visible = Me.checkbox

    2. command button (or maybe a toggle button)
    Me.subformname.Form.textboxname.Visible = Not Me.subformname.textboxname.Visible

    Also, textbox cannot have focus.
    To provide db: Make copy, remove confidential data, run compact & repair, zip if large - 2mb allowed, attach to post. Attachment Manager is below the Advanced post editor window.
    If suggestion in this post resolves your issue, please use the Thread Tools and mark the thread as Solved!

    Debug!Debug!Debug! http://www.cpearson.com/excel/debug.htm

  3. #3
    accote is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    35
    Hi June7, thanks for the input, but I can't change it to continuous view as there is a one to many
    relationship between the 2 tables the forms get their value from.
    The Main form is a Single Form and the Sub form only shows correctly in Datasheet view.
    Thanks for trying.

    accote

  4. #4
    June7's Avatar
    June7 is online now Moderator
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    28,530
    The subform can still be Single or Continuous view. Controls in Continuous view can be arranged to appear as Datasheet. If the controls are grouped in a Layout, select all and right click Layout>Remove. Then the controls can be moved and resized as desired.
    To provide db: Make copy, remove confidential data, run compact & repair, zip if large - 2mb allowed, attach to post. Attachment Manager is below the Advanced post editor window.
    If suggestion in this post resolves your issue, please use the Thread Tools and mark the thread as Solved!

    Debug!Debug!Debug! http://www.cpearson.com/excel/debug.htm

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

Similar Threads

  1. Hide Access and show only my forms
    By mortenskipper in forum Access
    Replies: 6
    Last Post: 03-10-2014, 03:02 AM
  2. Replies: 3
    Last Post: 10-31-2012, 11:14 AM
  3. Replies: 5
    Last Post: 04-06-2012, 09:59 AM
  4. Check-box to hide/show input fields
    By RapidFireGT in forum Forms
    Replies: 2
    Last Post: 12-05-2011, 03:55 PM
  5. how to hide the fields in subform
    By tinytree in forum Forms
    Replies: 3
    Last Post: 05-01-2009, 06:56 AM

Tags for this Thread

Posting Permissions

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