Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robwelan/96b43f66cce95a32b1bffb875b77e431 to your computer and use it in GitHub Desktop.
Save robwelan/96b43f66cce95a32b1bffb875b77e431 to your computer and use it in GitHub Desktop.
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