在每个form中都控制一下!

解决方案 »

  1.   

    每个form都要加,不知道有没有别的办法?
      

  2.   

    Hi, but I don't want add the error trap for every form and for every procedure.and even I add the error trap in the form, for normal error, it can be captured such as i=i/0, but as the error raise from DAO, it still could not be capture by the error trap.how to solve this problem?
      

  3.   

    最好在模块里加一个错误处理,然后每个屏幕都可以调用Public Sub ErrorHandler()
        MsgBox Err.Description + Chr(13) + "请找系统管理员检查", vbExclamation, cProgramName
    End Sub屏幕private sub cmdOk_click()
    on error goto cError        ....
         exit sub
    cError:
        call ErrorHandler    '调用模块
    end sub 
      

  4.   

    最好在模块里加一个错误处理,然后每个屏幕都可以调用Public Sub ErrorHandler()
        MsgBox Err.Description + Chr(13) + "请找系统管理员检查", vbExclamation, cProgramName
    End Sub屏幕private sub cmdOk_click()
    on error goto cError        ....
         exit sub
    cError:
        call ErrorHandler    '调用模块
    end sub 
      

  5.   

    最好在模块里加一个错误处理,然后每个屏幕都可以调用Public Sub ErrorHandler()
        MsgBox Err.Description + Chr(13) + "请找系统管理员检查", vbExclamation, cProgramName
    End Sub屏幕private sub cmdOk_click()
    on error goto cError        ....
         exit sub
    cError:
        call ErrorHandler    '调用模块
    end sub