Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wild character to find table in Access 2003 1

Status
Not open for further replies.

lbigk

MIS
May 24, 2002
58
US
Hello,
I used Access 97 for years, but now I have to switch to Access 2003. I am trying to delete any table that has the word "Error" in it's name.

I was trying a very simple command:
DoCmd.DeleteObject acTable, "*Errors*"

However, Access 2003 doesn't see "*" as any character. I also tested % and _ , according to Microsoft site it should have work, it doesn't.

Any assistance would be great.
Thank you.
 
You could try tabledefs.

Code:
Set db=CurrentDB
For Each tdf In db.TableDefs
  If Instr(tdf.Name,"Error")>0 Then
     DoCmd.DeleteObject acTable, tdf.Name
  End If
Next

Or there abouts.
 
I do not think there is a system table with Error in the name, but you may wish to watch out for system tables: the names all start MSys.
 
Thank you, Remou, it worked perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top