Steve wrote:
[Quoted Text] > Good day. > > Looking for some code that will delete all the tables from a different > database than the one that the code is running in. In other words, > open an .mdb, click a button and delete all the tables from a > different database on the server. > > Any ideas? Thank you.
(air code)
Sub KillTables()
Dim db As Database Dim tbl As TableDef Dim i As Integer
Set db = Workspaces(0).OpenDatabase("Path To Other MDB")
For i = db.TableDefs.Count - 1 To 0 Set tbl = db.TableDefs(i) db.TableDefs.Delete tbl.Name Next i
End Sub
-- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com
|