Results 1 to 4 of 4
  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 VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    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.
    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
    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 VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    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.
    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.

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: 8
    Last Post: 01-20-2016, 08:21 AM
  2. Replies: 3
    Last Post: 10-31-2012, 12:14 PM
  3. Replies: 5
    Last Post: 04-06-2012, 10:59 AM
  4. Check-box to hide/show input fields
    By RapidFireGT in forum Forms
    Replies: 2
    Last Post: 12-05-2011, 05:55 PM
  5. how to hide the fields in subform
    By tinytree in forum Forms
    Replies: 3
    Last Post: 05-01-2009, 07: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
  •  
Other Forums: Microsoft Office Forums