L
Lars Brownies
In inherited the code beneath. I never use the GoTo option other than for
the err_handler.
What does the code
<<On Error GoTo 0>>
actually do?
Is it necessary or can it be written in a better way?
Thanks
Lars
Function pfCompactRepairDB(strSource As String, strDestination As String) As
Boolean
On Error GoTo Err_Handler
pfCompactRepairDB = Application.CompactRepair(LogFile:=True,
SourceFile:=strSource, DestinationFile:=strDestination)
' Reset the error trap and exit the function.
On Error GoTo 0
Exit Function
Err_Handler:
pfCompactRepairDB = False
Dim strError As String
strError = "Error: " & Err.Number & ": " & Err.Description
MsgBox strError: Call ErrorLog("Generic", "pfCompactRepairDB", strError)
End Function
the err_handler.
What does the code
<<On Error GoTo 0>>
actually do?
Is it necessary or can it be written in a better way?
Thanks
Lars
Function pfCompactRepairDB(strSource As String, strDestination As String) As
Boolean
On Error GoTo Err_Handler
pfCompactRepairDB = Application.CompactRepair(LogFile:=True,
SourceFile:=strSource, DestinationFile:=strDestination)
' Reset the error trap and exit the function.
On Error GoTo 0
Exit Function
Err_Handler:
pfCompactRepairDB = False
Dim strError As String
strError = "Error: " & Err.Number & ": " & Err.Description
MsgBox strError: Call ErrorLog("Generic", "pfCompactRepairDB", strError)
End Function