Access is probably not the most popular components of Microsoft Office, however, to those who use it, it provides a lot of power and functionality. Databases can take enormous amounts of time to compile and analyze so it is a major setback to any project should a query or table be accidentally deleted. I recently found a quick bit of code that could help you quickly get it back without much trouble at all. Wayne Phillips at Everything Access put together a short bit of VBA code that can get your tables and queries back after they have been deleted. Phillips explains nothing really happens to your deleted components until your database is compacted, after which you are pretty much out of luck. Access renames the file and the code Phillips wrote looks for files with the new naming convention. Once it finds them you are given the option to rename them and they are restored. The actual procedure of implementing the code is pretty simple. Just copy the code, paste it into a new module called FnUndeleteObjects, and then create a macro to run it using the runCode option. It looks like this will only work with Access versions of 2003 and before, and only if you have not compacted or closed the database. This probably a good piece of code to put into any Access database you use frequently and value highly in order to be able to use it right when you need it. Also, as a good precaution, when working with large valuable files, it is usually best to work in a copy and have multiple backups going back a few versions; extra storage is much less than a week’s worth of work. -save now for a save later

Technorati: