Results 1 to 7 of 7
  1. #1
    nahum abramovich is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jun 2018
    Posts
    62

    duplicate forms

    Hey


    Probably never asked such a question here but worth a try.

    i created main form with 10 buttons - every button open form with more 10 buttons and then every button open one form.
    in total i have 111 designed forms. in addition i defined that when i tap some button it open the form and close current form window .

    now to my question...

    i want to copy the exact same 57 designed forms with different forms name (obvious) and i want to keep the definition that i did that when i tap on some button .... form is open and the current form window closed...

    If there are not many options i kindly ask you to give me a partial solution - anything that will shorten the replication process of my forms.

    There may be God and I will not have to create the forms again.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    'make a list of the forms in the debug window to copy into a table:
    Code:
    Dim dbs, obj
    Set dbs = Application.CurrentProject
    For Each obj In dbs.AllForms
      Debug.Print obj.Name
    Next
    End Sub
    


    then cycle thru the table (listbox) and copy them to the new name:
    vSrcFrm = lstForm
    vTargFrm ="new_" & vSrcFrm

    DoCmd.CopyObject , vTargFrm, acForm, vSrcFrm

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,894
    Is this a one-time occurrence?

    Why do you need duplicate forms?

    What are you really trying to accomplish?
    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.

  4. #4
    nahum abramovich is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jun 2018
    Posts
    62
    It seems to go beyond my scant knowledge in access...

    hope you can be patient with me....

    i click database tools then click visual basic than click tools and then click macros... (create the name for macro) the general window is open then i write this code and press run sub (F5)?

    about the second thing i didn't understand what i need to do at all ...

    maybe you can guide me step by step... ? as explained to anyone who has never seen Access...

  5. #5
    nahum abramovich is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jun 2018
    Posts
    62
    Hey


    One time I have to do this.
    I will change some things manually and in specific places on the copied forms but I will do the duplication once.


    All the forms with the buttons are basically departments and machines and maintenance tasks in the company I work for - but this whole chapter belongs to one factory . I want to do the same to the other factory and keep it in the same main screen and the same file.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,894
    Since I don't know your database structure, hard to provide specific guidance. But building duplicate forms should not be necessary. Apply filter criteria to restrict records displayed on form.

    Have you even studied Access tutorials? Might spend a solid week studying an introductory book to learn basics of relational database principles, Access functionality, programming concepts, VBA and/or macro coding.
    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.

  7. #7
    nahum abramovich is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jun 2018
    Posts
    62
    understood
    thank you

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

Similar Threads

  1. Replies: 8
    Last Post: 12-16-2018, 06:45 AM
  2. Replies: 8
    Last Post: 04-10-2018, 01:31 AM
  3. SUm duplicate values then delete duplicate rows
    By DonKaponne in forum Queries
    Replies: 1
    Last Post: 09-14-2014, 04:18 PM
  4. Replies: 2
    Last Post: 08-05-2014, 07:06 AM
  5. Replies: 3
    Last Post: 03-01-2013, 12:41 PM

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