I use this convention frequently:
Exit_Here:
Exit Sub
HandleErr:
Select Case Err.Number
Case 3163
Resume Next
Case 3376
Resume Next
Case Else
MsgBox "Error Number " & Err.Number & ": " & Err.Description
Resume Exit_Here
End Select
Is there a way to include the current procedure name on Case Else?
perhaps something like this:
Case Else
MsgBox "Error Number " & Err.Number & ": " & Err.Description &
vbCrLf & _
Me.ProcedureNam e & Me.Form
Resume Exit_Here
End Select
(note: "Me.ProcedureNa me" is pseudo code - I don't know if it's possible to
get this...)
How about offloading this to a module so I don't have to type it out every
time:
Case Else
strP = Me!Procedure
strF = Me.Form
modErr.caseElse
End Select
thoughts ? suggestions ?
Thanks in advance...
Exit_Here:
Exit Sub
HandleErr:
Select Case Err.Number
Case 3163
Resume Next
Case 3376
Resume Next
Case Else
MsgBox "Error Number " & Err.Number & ": " & Err.Description
Resume Exit_Here
End Select
Is there a way to include the current procedure name on Case Else?
perhaps something like this:
Case Else
MsgBox "Error Number " & Err.Number & ": " & Err.Description &
vbCrLf & _
Me.ProcedureNam e & Me.Form
Resume Exit_Here
End Select
(note: "Me.ProcedureNa me" is pseudo code - I don't know if it's possible to
get this...)
How about offloading this to a module so I don't have to type it out every
time:
Case Else
strP = Me!Procedure
strF = Me.Form
modErr.caseElse
End Select
thoughts ? suggestions ?
Thanks in advance...
Comment