Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to skip command delete table (Access 2000)

    How to skip command Delete Table if the table doesnt exist

    I have a code like this:

    DoCmd.deleteobject acTable, "tblClients"

    However if the table doesnt exist.which may also be the case,then the code stops and i receive the message that the table doesnt exist.My question is can i have the above delete command execute only whenthere is a table tblClients,but not to stop if the table is not available.

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: how to skip command delete table (Access 2000)

    You need to put in some sort of error handling. At a minimum, you could put a line of code immediately before your Docmd that looks like this:

    On error resume next

    Or, instead of Resume, you can GOTO an error handler function which checks the err.num for specific errors, and then responds appropriately.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •