Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005

    Unanswered: MS Access Multirow insert....

    I am trying do a simple insert into several tables. the information is for Demo mode. so when the user is in demo mode i want to add/dump some rows of into multiple tables. currently i am doing this one row at a time.
    insert into table1 values (.....)
    insert into table1 values (.....)
    What is the proper syntax for adding all the rows in one sql command.

  2. #2
    Join Date
    Feb 2004
    Chicago, IL
    If you are specifying the values to be put in the row and not appending data from another query or table then you have to do it one row at a time. But you can put a loop around the SQL to execute it several times.

    For i=1 to 10
       strSQL="Blah Blah"
       DoCmd. RunSQL strSQL
    Next i
    Last edited by DCKunkle; 10-09-09 at 16:31.

  3. #3
    Join Date
    Nov 2007
    Adelaide, South Australia
    If the data is all the same, do what DCK said, if the data is different for each record, keep doing what you're doing.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts