Solved

how can i delete in access 2013 with vba every table that starts with Backup_"

Posted on 2013-06-07
2
590 Views
Last Modified: 2013-06-07
hi

I am looking for a way to delete with vba any table that begins with "Backup_",

thanks
0
Comment
Question by:bill201
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 39228584
Backup before testing!!!!!!!!!!

Sub deltab()
Dim tdf As DAO.TableDef
For Each tdf In CurrentDb.TableDefs
If Left(tdf.Name, 7) = "backup_" Then
DoCmd.DeleteObject acTable, tdf.Name
Next tdf

End Sub
0
 

Author Closing Comment

by:bill201
ID: 39228809
Thanks a lot
Excellent code only need to add end if
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question