How to Insert data into a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sarah2855
    New Member
    • May 2010
    • 21

    How to Insert data into a table

    I have opened a recordset and now I want to copy all the records of that recordset to a table.
    Code:
    set rs = db.OpenRecordset("SELECT ID FROM Customers")
    This command gives me the list of all Ids in Customer Table.
    How can I now Insert this list in to a table?
    Last edited by NeoPa; Jun 13 '10, 11:33 AM. Reason: Please use the [CODE] tags provided
  • sarah2855
    New Member
    • May 2010
    • 21

    #2
    I got it myself I needed to do:
    Code:
    strSQL = "INSERT INTO temp( ID )" & _
             "SELECT ID FROM Customers"
    Last edited by NeoPa; Jun 13 '10, 11:34 AM. Reason: Please use the [CODE] tags provided

    Comment

    Working...