D
DS
I have this code that is surrounded by other code so I'm wondering how
to add Error code to it, I only want the onError for thia particular
snipet of code, not the rest of it behind the command button. The error
would be that the path doesn't exist. In that case I would not run the
code. So I guess I should check for the path first? But how? Perhaps
then it's an if statement not an error code.
If Path exists Then
Run
Else
End if
Thanks
DS
Dim Test2SQL As String
DoCmd.SetWarnings False
Test2SQL = "UPDATE table1 IN ""c:\PROSERV\OLDSTUFF\BDatabase.mdb"" " & _
"SET table1.IDName = ""Newdog"" " & _
"WHERE table1.IDNumber = 1 ;"
DoCmd.RunSQL (Test2SQL)
to add Error code to it, I only want the onError for thia particular
snipet of code, not the rest of it behind the command button. The error
would be that the path doesn't exist. In that case I would not run the
code. So I guess I should check for the path first? But how? Perhaps
then it's an if statement not an error code.
If Path exists Then
Run
Else
End if
Thanks
DS
Dim Test2SQL As String
DoCmd.SetWarnings False
Test2SQL = "UPDATE table1 IN ""c:\PROSERV\OLDSTUFF\BDatabase.mdb"" " & _
"SET table1.IDName = ""Newdog"" " & _
"WHERE table1.IDNumber = 1 ;"
DoCmd.RunSQL (Test2SQL)