smidgen
asked on
Delete Table Module
I'm running a module in access to delete a table each day but I have more than one table that needs to be deleted
the code is;
Public Function DeleteTable()
Dim tdf As TableDef
For Each tdf In CurrentDb.TableDefs
If tdf.Name = "B0101" Then
DoCmd.DeleteObject acTable, tdf.Name
CurrentDb.TableDefs.Refres h
End If
Next tdf
End Function
but I need to delete "B0101", "B0102", "B0103" etc....
can someone show me how to add the other tables into the code?
the code is;
Public Function DeleteTable()
Dim tdf As TableDef
For Each tdf In CurrentDb.TableDefs
If tdf.Name = "B0101" Then
DoCmd.DeleteObject acTable, tdf.Name
CurrentDb.TableDefs.Refres
End If
Next tdf
End Function
but I need to delete "B0101", "B0102", "B0103" etc....
can someone show me how to add the other tables into the code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks peter57r
worked perfectly
worked perfectly
Thanks
Pete
Pete
Dim tdf As TableDef
For Each tdf In CurrentDb.TableDefs
If (tdf.Name = "B0101" or tdf.Name = "B0102" or tdf.Name = "B0103") Then
DoCmd.DeleteObject acTable, tdf.Name
CurrentDb.TableDefs.Refres
End If
Next tdf
End Function
but I need to delete "B0101", "B0102", "B0103" etc....
can someone show me how to add the other tables into the code?