Created
June 17, 2020 21:02
-
-
Save robwelan/96b43f66cce95a32b1bffb875b77e431 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function ExecuteSQL(strSQL As String) As Boolean | |
Dim adb As DAO.Database | |
On Error GoTo handle_Error | |
ExecuteSQL = False | |
Set adb = CurrentDb adb.Execute strSQL$, dbFailOnError | |
ExecuteSQL = True | |
exit_Gracefully: | |
On Error Resume Next | |
Set adb = Nothing | |
Exit Function | |
handle_Error: | |
MsgBox "Error " & Err.Number & " " & Err.Description & " in ExecuteSQL function." | |
Resume exit_Gracefully | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment