Results 1 to 2 of 2
  1. #1
    SamTyco is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    1

    Automatically Add Records

    Hi,
    I have a database which keeps track of projects and the various tasks associated with them. At present, there are 3 different types of projects that always have the same tasks. What I would like to do is that when someone creates a new project (form), the database would add records to the "Tasks" table corresponding to the necessary tasks for that type of project with values filled in based off the form.

    For example, the form would contain:
    Project Name: Awesome Stuff
    Project Type: Type 1
    Created By: John Doe

    Upon clicking a "Add New Project" button, the database would add the following records to the "Tasks" table

    Task ID Project Name Task Name Assigned To Start date
    1 Awesome Stuff Open Task John Doe Date()
    2 Awesome Stuff Order Parts Claire Orderer
    3 Awesome Stuff Assemble Parts Pat Assembler
    4 Awesome Stuff Ship Product Sam Shipper




    The database would base what tasks it adds on the Project type.

    Can anyone help me here?

    Sam

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Requires code (I use only VBA) that would execute SQL INSERT statement for each record.

    DoCmd.SetWarnings False
    DoCmd.RunSQL "INSERT INTO ..."
    'repeat DoCmd for each desired record
    DoCmd.SetWarnings True
    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: 2
    Last Post: 07-28-2011, 09:20 PM
  2. automatically add records to linked table
    By bcrozier in forum Database Design
    Replies: 3
    Last Post: 04-07-2011, 09:03 PM
  3. Automatically do... everything?
    By .:SoundWave:. in forum Access
    Replies: 4
    Last Post: 12-11-2010, 07:41 PM
  4. How to Automatically Group
    By SSgtJ in forum Reports
    Replies: 3
    Last Post: 05-17-2010, 12:25 PM
  5. Replies: 2
    Last Post: 09-10-2009, 08:21 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