ACC: How to Delete Objects Programmatically

Last reviewed: June 8, 1997
Article 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 using either the Delete method or the DeleteObject method. The DeleteObject action can also be used in macros.

MORE INFORMATION

The Delete method applies to the QueryDefs and TableDefs data access 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 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 PgmOthr
Version : 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.