Copy a table using code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top