DoCmd.DeleteObject (Access)
The DeleteObject method carries out the DeleteObject action in Visual Basic.
You can use the DeleteObject method to delete a specified database object. If you leave the ObjectType and ObjectName arguments blank (the default constant, acDefault, is assumed for ObjectType), Access deletes 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 InDatabaseWindow argument set to Yes (True).
DeleteObject (ObjectType, ObjectName)
DoCmd.DeleteObject acTable, "Former Employees Table"
Arguments
Optional arguments
The following arguments are optional
ObjectType (AcObjectType) - An AcObjectType constant that represents the type of object to delete.
Here you can find possible values for
ObjectName (String) - A string expression that's the valid name of an object of the type selected by the ObjectType argument. If you run Visual Basic code containing the DeleteObject method in a library database, Microsoft Access looks for the object with this name first in the library database, and then in the current database.