Results 1 to 3 of 3
  1. #1
    altemir is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    31

    Programatically Add Columns to a Datasheet


    Is there a way to programatically add (and remove) columns to a datasheet that I have in a subform using VBA?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    From the Master form
    Me.subformName.Form.YourControlName.ColumnWidth = -1
    will show the column and
    Me.subformName.Form.YourControlName.ColumnWidth = 0
    will hide the column.
    Change subformName with the name of your subform control and change YourControlName with the column name that you want to Show/Hide
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    altemir is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    31
    It's not a question of showing or hiding. I really want to add or delete field controls in the subform the way I ordinarily would in design View.

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

Similar Threads

  1. Missing Columns in Datasheet View
    By mikel in forum Access
    Replies: 3
    Last Post: 01-02-2015, 01:57 PM
  2. Help fixing a code to change password programatically
    By smartflashes in forum Programming
    Replies: 3
    Last Post: 01-19-2012, 10:20 PM
  3. Replies: 8
    Last Post: 09-05-2011, 11:16 PM
  4. Replies: 1
    Last Post: 05-23-2011, 07:11 AM
  5. Generate datasheet columns on the fly?
    By kman42 in forum Programming
    Replies: 0
    Last Post: 03-11-2011, 03:52 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