Sub delObj()
On error resume next
Dim acc As Access.Application
Set acc = New Access.Application
acc.OpenCurrentDatabase "C:\MyFolder\MyDb.accdb"
acc.DoCmd.DeleteObject acTable, "MyTbl"
acc.DoCmd.CopyObject , "MyTbl", acTable, "Products"
acc.CloseCurrentDatabase
Set acc = Nothing
End Sub
|