DoCmd.DeleteObject

Delete a database object.

Syntax
      DoCmd.DeleteObject(ObjectType, ObjectName)

Key
   ObjectType  An AcObjectType constant that represents the type
                    of object to copy.

   ObjectName  The name of an object to delete.

Either destinationdatabase or newname (or both) must be specified.

If sourceobjecttype and sourceobjectname arguments are left blank, Access will delete the object selected in the Database window.

To select an object in the Database window, you can use the SelectObject action or SelectObject method with the In Database Window argument set to Yes (True).

Example

DoCmd.DeleteObject acTable, "T_Patients"

“It devoured my paper, it was a really good paper” - Ellen Feiss

Related:

CopyObject - Copy an Access database object
Rename - Rename an object.


 
Copyright © SS64.com 1999-2019
Some rights reserved