On Error Resume Next 的替代方法。
Public Function AddArea_Area() As String
On Error GoTo ErrTrap
AddArea_Area = ""
With m_frmArea_Edit
.Caption = "添加区域"
.btnSave.Tag = "Insert"
.txtProp(0).Text = ""
.txtProp(1).Text = ""
.txtProp(2).Text = ""
.Show vbModal
End With
Exit Function
ErrTrap:
AddArea_Area = MyApp.dfSemCreate("mdArea.AddArea_Area", Err.Number, Err.Description)
On Error GoTo 0
End Function
有的错误不是On error resume next能够解决了,比如:死循环错误。所以,要把所有出现的错误都考虑到。