Results 1 to 2 of 2
  1. #1
    cykchanaa is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2015
    Posts
    4

    How to show/hide columns in a query using a form checkbox?


    Currently I have a query where the criteria is dependent on the combo boxes on my form. I would like to add checkboxes to my form which determines which fields are shown or hidden. For example if I had a checkbox for address, selecting it on my form will show the address column in my query results. I am very new to access and have not been able to find a solution to a similar task online.

    Any help would be greatly appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Open a table or query and right click on any field header, from shortcut menu choose Hide or Unhide fields. Is this what you want to do programmatically? Not really practical with table or query.

    The following code will hide table or query field that has the focus:
    DoCmd.RunCommand acCmdHideColumns

    The following example will hide a field of form in Datasheet view - it actually refers to a textbox name:
    Forms!Games!tbxStartDate.ColumnHidden = True

    https://msdn.microsoft.com/en-us/lib...ffice.11).aspx
    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. Replies: 1
    Last Post: 11-26-2014, 02:30 PM
  2. Replies: 3
    Last Post: 01-14-2014, 04:17 PM
  3. show / hide columns based on criteria?
    By stevepcne in forum Access
    Replies: 1
    Last Post: 11-18-2011, 02:49 PM
  4. Replies: 6
    Last Post: 02-24-2011, 03:24 PM
  5. Show/Hide Columns in a Query
    By SCFM in forum Access
    Replies: 1
    Last Post: 02-23-2010, 08:04 AM

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