Delete a table only if it exists

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Riun
    New Member
    • Oct 2006
    • 34

    Delete a table only if it exists

    Hi,

    Sometimes, when my table is imported, there are blank cells and an ImportError table gets created in Access.
    That table needs to be deleted. But the problem is that if I put the code in:

    Code:
      DoCmd.DeleteObject acTable, "Agri_Futures_9196$_ImportErrors"
    and the table doesn't exist, an error message is popping up.

    What do I need in my IF statement to cater for this?

    Thanks,
    R
  • Dan2kx
    Contributor
    • Oct 2007
    • 365

    #2
    Could you put on error resume next?

    Comment

    Working...