Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 623
  • Last Modified:

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

hi

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

thanks
0
bill201
Asked:
bill201
1 Solution
 
peter57rCommented:
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
 
bill201Author Commented:
Thanks a lot
Excellent code only need to add end if
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now