Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Blackkimba851 is offline Novice
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    16

    Create New Project and duplicate entire table with new name????? Access 2007-2016

    I have a table that has (Project Name),(Room),(Task),(Status). There are about 250 Tasks per Project that are the same for each Project. Just the name and the status will change in the table. How do I add a new Project and create a new table or add to a table with all the rooms and tasks the same but with a new Project name and the status set to (By Default) Incomplete. All Projects will have the same Data in them (Room,Task). I would like to do this with a "Create New Project" Button Macro, Enter name an then have it create the new table or add to a table.


    I hope I explained it the right way
    Any ideas

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You haven't mentioned your structure. You almost certainly don't want another table. Perhaps:

    http://allenbrowne.com/ser-57.html
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  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,902
    Do you have a Tasks table that has these 250 tasks? If not, then pick a project to copy. Consider:
    Code:
    CurrentDb.Execute "INSERT INTO ProjectTasks([Project Name], Room, Task, Status) SELECT '" & Me.textboxname & "', Room, Task, 'Incomplete' FROM ProjectTasks WHERE [Project Name]='some project to copy'"
    Have you already committed master record in Projects table first?
    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
    Blackkimba851 is offline Novice
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    16
    Powers Utility Room Ductwork Repaired Not Done
    Powers Utility Room Electrical Covers Not Done
    Powers Utility Room Electrical GFCI Not Done
    Powers Utility Room Electrical Lights Not Done
    Powers Utility Room Electrical Outlets Not Done
    Powers Utility Room Electrical Panel Repaired Not Done
    Powers Utility Room Electrical Repaired/Installed Not Done
    Powers Utility Room Electrical Switches Not Done
    Powers Utility Room Furnace Repaired Not Done
    Powers Utility Room Gas Lines Repaired Not Done
    Powers Utility Room Pluming Drain Repaired Not Done

    Project, Room, Task, Status

    This is what my table looks like. I do not have a Task table. all data is in the same table.

  5. #5
    Blackkimba851 is offline Novice
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    16
    Powers Utility Room Ductwork Repaired Not Done
    Powers Utility Room Electrical Covers Not Done
    Powers Utility Room Electrical GFCI Not Done
    Powers Utility Room Electrical Lights Not Done
    Powers Utility Room Electrical Outlets Not Done
    Powers Utility Room Electrical Panel Repaired Not Done
    Powers Utility Room Electrical Repaired/Installed Not Done
    Powers Utility Room Electrical Switches Not Done
    Powers Utility Room Furnace Repaired Not Done
    Powers Utility Room Gas Lines Repaired Not Done
    Powers Utility Room Pluming Drain Repaired Not Done


    Project, Room, Task, Status

    This is what my table looks like. I do not have a Task table. all data is in the same table.

  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,902
    Okay, did you try suggested code?
    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
    Blackkimba851 is offline Novice
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    16
    Yes i did. but it only created one record. I need it to do all 250 records. should i create a table with just the rooms and tasks to use as a template?

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    It should have created multiple records. Post your code or provide db for analysis. Follow instructions at bottom of my post.
    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.

  9. #9
    Blackkimba851 is offline Novice
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    16
    Here is the db
    Attached Files Attached Files

  10. #10
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    Black-davegri-v01.zip
    Have a look at this. Creates new table with project name.

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    I agree with Paul that creating multiple project tables is not desirable design.

    The Project field in AllInOne table is empty so of course the INSERT could not copy data. If there were data in Project field, would substitute "some project to copy" with an actual project reference.

    A tasks template table is an option. Then the WHERE clause will not be needed.
    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.

  12. #12
    Blackkimba851 is offline Novice
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    16
    That will work. Then I can just delete the table when i'm done with it. thx for your help

  13. #13
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    Quote Originally Posted by Blackkimba851 View Post
    That will work. Then I can just delete the table when i'm done with it. thx for your help
    U Bet. Good luck with the rest of the project.

  14. #14
    Blackkimba851 is offline Novice
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    16

    new ?

    Is there a way to set the format of the newly created table with wider columns ( not the default widths ) and also with the "status" column into a combo box so it can be edited right from the table. Right now I have to edit the table for each new Project that I create.
    Project Room Task Status
    powers Utility Room Pluming Furn Incomplete
    Powers /Utility /Plumbing Furnace /Incomplete <to look more like this>

  15. #15
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Why are column widths in tables important? Should use forms bound to table/query.

    I never set lookups in table.

    Already advised should not create new table for each project. Should be 1 table.
    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.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 09-16-2018, 12:50 PM
  2. Replies: 4
    Last Post: 02-03-2017, 02:34 PM
  3. Replies: 2
    Last Post: 02-23-2016, 04:36 PM
  4. Replies: 6
    Last Post: 07-11-2012, 10:13 PM
  5. Replies: 7
    Last Post: 12-30-2009, 11:03 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