ACC1x: "Table Does Not Exist" Error Message When Deleting Table

Last reviewed: May 14, 1997
Article ID: Q101370
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SYMPTOMS

In Microsoft Access version 1.x, if an Access Basic function creates a table with a QueryDef() function, and then attempts to delete that table, the following error message appears:

   Table does not exist.

The new table does not get deleted, and is not displayed in the Database window until the window is refreshed.

CAUSE

If the Database window is displaying the tables while the function is being run, the Database window must be refreshed to display the new table before it can be deleted.

RESOLUTION

Refresh the Database window before attempting to delete the table. To do this, choose another object (for example, forms) in the Database window, then display the tables again.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

The following function uses the sample database NWIND.MDB to demonstrate how to create the table and then successfully delete it. Make sure that you choose Table in the Database window before you run the function below.

NOTE: In the following sample code, an underscore (_) is used as a line-continuation character. Remove the underscore when re-creating this code in Access Basic.

   Function DeleteThisTable ()
      Dim mydb As Database, myq As QueryDef
      Set mydb = CurrentDB()
      Set myq = mydb.CreateQueryDef("createtablequery")
      'Create the Table
      myq.sql = "SELECT  DISTINCTROW Customers.[Customer ID], _
                   Customers.[Company Name] INTO test FROM Customers;"
      myq.Execute

      'Choose any object other than Table to refresh Database
      'window.
      'NOTE: Omit the following line to reproduce the problem:

      DoCmd SelectObject A_FORM, "Customers", True

      'Delete the table
      DoCmd SelectObject A_TABLE, "test", True
      DoCmd DoMenuItem A_DATABASE, A_EDIT, A_DELETE
   End Function


Additional query words: QueryDef refresh
Keywords : kberrmsg kbusage TblModfy
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


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: May 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.