Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004

    Unanswered: how to supress messages


    Am trying to drop tables in access.Problem is: whenever there is no such table as mentioned, I get an error message saying table doess not exist, and my automated program stops.

    I have done an automation through batch file and hence would require, that
    even if there be an error message, it be supressed completely.

    I have uncheck the confirm options in access, yet when dropping tables , message is popping up...

    Please help me...


  2. #2
    Join Date
    Mar 2004

    Re: How to supress messages

    If you are using visual basic, you can implement an error trap subrutine. For example:

    Static Sub YourProcedureName()
    On Error Goto Err_YourProcedureName

    YourProcedureCode here

    Exit Sub

    If Err = Theerrornumberyouwanttotrap Then
    Resume [Next]
    MsgBox error$
    Resume Exit_YourProcedureName
    End Sub

    Hope this answer your question

    Ing. Jesús Rodríguez L.
    Spanish Pawn Software Specialists

  3. #3
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    You could check the AllTables collection to see if it exists before trying to drop it as well.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Feb 2004
    Chicago, IL
    Are you using SQL to drop the table? Can you use DoCmd.DeleteObject?

    Whenever I need to delete a table I have always used DeleteObject and if you surround it with error trapping code then it should work, example:

    On Error Resume Next
    DoCmd.DeleteObject acTable, "tblYourTable"
    On Error Goto 0 (or your error handling label)

    I assume the only error will be that the table doesn't exist. If the table could not be deleted for some other reason it will be igrnored. I personally have never had a problem with this code.

Posting Permissions

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