M
Maarkr
I ran across an access db that had all code references to On Error, Err_,
and Exit_ stripped out... it looked so clean and i was wondering how many
people actually do this? I can understand how some of my code does have some
necessary error handling routines, but for a simple form opening or
run-of-the-mill command button code from a wizard, should I clean up the
stuff that microsoft adds in? As an example compare:
Private Sub Command18_Click()
On Error GoTo Err_Command18_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Wx_radar"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command18_Click:
Exit Sub
Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click
End Sub
--here's the same thing condensed and stripped down:
Private Sub Command18_Click()
DoCmd.OpenForm "Wx_radar"
End Sub
What do you think?
and Exit_ stripped out... it looked so clean and i was wondering how many
people actually do this? I can understand how some of my code does have some
necessary error handling routines, but for a simple form opening or
run-of-the-mill command button code from a wizard, should I clean up the
stuff that microsoft adds in? As an example compare:
Private Sub Command18_Click()
On Error GoTo Err_Command18_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Wx_radar"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command18_Click:
Exit Sub
Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click
End Sub
--here's the same thing condensed and stripped down:
Private Sub Command18_Click()
DoCmd.OpenForm "Wx_radar"
End Sub
What do you think?