Results 1 to 5 of 5
  1. #1
    jameslefebv is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    2

    Add Command Button to Multiple Forms

    Hey everyone, I have an Access database with hundreds of forms, and I found out that I have to add a command button to all of them. This could take days to do.



    Is there anyway of adding a command button to multiple forms at once?
    I tried looking for an add-in but couldn't find anything.

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    You need to take resort to vba. Look access help for Createcontrol method. You have to loop through all the forms collection, open in design view,add the button , save & close the form, all in code. The button created will be of same specification for all forms- like font. size, left & top margins etc.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    hundreds of forms is highly unusual in an Access database.

    that said - I would be challenged to attempt that task via visual code....and it would need to be done manually. This is where the button's action being a macro, rather than VBA, would be an advantage - as one can copy a button with a macro in one copy/paste step and the macro gets copied also......

  4. #4
    bobdog is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2014
    Posts
    1
    If I'm not mistaken, you can simply copy and paste the control from one screen to another. All of its attributes come along with it, although I don't think VBA code comes along with it.

    This also works in reports, which greatly simplifies the cosmetic cleanup of multiple reports, such as getting uniform report headers and footers.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    I also think that is an inordinately high number of forms. Why so many? Are there duplicates when perhaps one form with filter criteria could serve? One form can be made to serve for entering new records as well as reviewing/editing existing records.
    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: 12
    Last Post: 10-20-2014, 11:22 AM
  2. Replies: 3
    Last Post: 11-19-2013, 11:30 AM
  3. Access 2010 Forms Command button Question
    By RayMilhon in forum Forms
    Replies: 3
    Last Post: 09-12-2011, 03:38 PM
  4. Replies: 1
    Last Post: 07-27-2010, 02:27 PM
  5. Replies: 5
    Last Post: 08-06-2009, 11:47 PM

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