ACC: How to Delete Objects Programmatically

ID: Q116148


The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0, 97


SUMMARY

Moderate: Requires basic macro, coding, and interoperability skills.

You can delete objects programmatically by using either the Delete method or the DeleteObject method. You can also use the DeleteObject action in macros.


MORE INFORMATION

The Delete method applies to the QueryDefs and TableDefs collections and can be used to delete queries and tables. The Delete method does not apply to the Containers collection and cannot be used to delete objects such as forms or reports.

You can use the DeleteObject method (in code) or action (in a macro) to delete objects that you cannot delete using the Delete method. Note that Microsoft Access does not request user confirmation when you delete objects by using either the Delete method or the DeleteObject method or action.


REFERENCES

For more information about "Delete", search the Help Index for "Delete Method."

For more information about DeleteObject, search the Help Index for "DeleteObject Action" or "DeleteObject Method."

Keywords : kbprg PgmObj
Version : 2.0 7.0 97
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: April 3, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.