Deleting Table that starts with ......

pdbowling

Registered User.
Local time
Today, 22:03
Joined
Feb 14, 2003
Messages
179
Hi all.
I've got a text file that I import into a table. It typically has lots of garbage in it that populates an automatic importErrors table.

I know that this importErrors table will always start with
"QRPT" and then be followed by a different set of digits each time.
Is there a 'delete object' capability in macros (or VB) that will let me delete all tables starting with "QRPT"?

If not, I'll capture the file name at import and just add _importErrors to it and do it that way. Just wandering if there was an easy way.
PB
 
Go on try some vba - you know you want to ;)




Dim db As Database
Dim tdf As TableDef

Set db = CurrentDb

For Each tdf In db.TableDefs
If tdf.Name Like "QRPT*" Then
DoCmd.DeleteObject acTable, tdf.Name
End If
Next
 

Users who are viewing this thread

Back
Top Bottom