Results 1 to 2 of 2
  1. #1
    rickscr is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    21

    Add record to multiple tables

    Here's what I need to do:

    I have a table for storing sample information. For a given sample, I need to generate 5 records in the sample table. In each record, all of the fields will be the same except for one.

    For example:


    Code:
    SampleID	SampleDate	SampleLocation	SampleMethod
    1	1-Jan	SiteB	Method1
    2	1-Jan	SiteB	Method2
    3	1-Jan	SiteB	Method3
    4	1-Jan	SiteB	Method4
    5	1-Jan	SiteB	Method5
    I want the user to enter the date and site, and click a button to add all 5 records. The Methods added will always be the same 5.

    I imagine there is some way to do this in VBA or a macro, but I haven't been able to figure it out.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    you can simply run an append sql statement 5 times behind the button's click event.

    do you know how to do that??

    or....if that doesn't sound good, make a table with 5 records in it, and write two lines of code behind the button: one for updating fields in the 5-rec table, and one for appending the entire table to a new table.

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

Similar Threads

  1. Multiple Tables
    By Jeriko in forum Access
    Replies: 0
    Last Post: 03-08-2011, 11:40 PM
  2. Multiple tables with the same value
    By Desverger in forum Programming
    Replies: 4
    Last Post: 08-31-2010, 12:21 PM
  3. Multiple tables/one record report
    By Smooth Operator in forum Reports
    Replies: 3
    Last Post: 06-24-2010, 09:43 AM
  4. Replies: 1
    Last Post: 12-10-2009, 08:41 PM
  5. From with multiple tables
    By Darth_Katarn in forum Access
    Replies: 1
    Last Post: 09-23-2009, 08:17 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