I know this may horrify everyone and questions may be asked. How do I delete all records from my Data base and resume it to an empty state leaving the tables queries codes unharmed everything still functional. Starting from total empty of data
I know this may horrify everyone and questions may be asked. How do I delete all records from my Data base and resume it to an empty state leaving the tables queries codes unharmed everything still functional. Starting from total empty of data
Check out the scripts in this thread here: http://stackoverflow.com/questions/6...tables-at-once
You want to be careful not to delete the data in the hidden system tables, or that could really mess things up!
Also, you will want to be sure to do a Compact & Repair after your deletion to keep the database from bloating (records really are not removed from the DB until you do this step, so the size will not decrease until you do this).
Create a new database and import everything that you want. Make copies of the tables first, "Structure Only"
If you have relationship with cascading Deletes, might only have to delete records from main table. But could use some delete queries or SQL in code:
Maybe sure you have a good backup of the data if needed before testing.
OnClick event on a button maybe(change names to your tables):
Docmd.SetWarnings False
DoCmd.RunSQL "Delete * from Table1"
DoCmd.RunSQL "Delete * from Table2"
Docmd.SetWarnings True
If it is just a one-time thing, I agree that this method is probably the safest and cleanest way. Importing to a new database is also a popular method of correcting corruption issues.Create a new database and import everything that you want. Make copies of the tables first, "Structure Only"
Just a few things to note if you do use this method. Be sure to include all your other Objects in your import (Queries, Reports, and Forms), and you may need to click on the Advanced Options to include things like Import Specifications and Relationships, if you use any of those things. And if you use a Startup Form, that setting will not transfer over, you will need to re-select that in your new db (no big deal).