Copy a table using code

K

KellyB

I'm building a form that allows the user to enter a table of about 30-50
records, then click a button to run a couple of append queries to dump the
new records to their appropriate locations in other tables.

To start, when the form opens, I want to create a copy of an existing table,
without any records, so that the structure of the table is always consistent.
The user adds the new records to this temporary table, then click a button
to run the error checking and append queries.

What is the best way to do this, or is there an even easier way to achieve
the same functionality?

Thanks.
 
O

Ofer

Create a Temporary table using copy and paste of the original table.
Then, on the On Open event of the form, run a delete query to delete all the
records from the table, insted of creating this table every time

Docmd.RunSql "DELETE TableName.* FROM TableName"
 
Top