p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

vba_access thread: Copying Tables


Message #1 by "John Anthony" <janthony@s...> on Mon, 11 Dec 2000 17:28:25 -0000
Why didn't you say so...

The Visual Basic Help section has this:

SELECT...INTO Statement Example

This example selects all records in the Employees table and copies them
into a new table named Emp Backup.

Sub SelectIntoX()

    Dim dbs As Database
    Dim qdf As QueryDef

    ' Modify this line to include the path to Northwind
    ' on your computer.

    Set dbs = OpenDatabase("Northwind.mdb")

    ' Select all records in the Employees table 
    ' and copy them into a new table, Emp Backup.

    dbs.Execute "SELECT Employees.* INTO " _
        & "[Emp Backup] FROM Employees;"

     ' Delete the table because this is a demonstration.

    dbs.Execute "DROP TABLE [Emp Backup];"
    dbs.Close

End Sub


Does this help?





  Return to Index