I have placed a constraint on a table to avoid inserting duplicate records.
When I create a duplicate I get an unfriendly error message box complaining about the constraint violation.
I would like to trap that error event, give a nice 'please be careful' message to the operator and then carry on processing.
The following code just ignores the error.
There must be a way to pick up the sql generated error in neat way.
Any suggestions?
When I create a duplicate I get an unfriendly error message box complaining about the constraint violation.
I would like to trap that error event, give a nice 'please be careful' message to the operator and then carry on processing.
The following code just ignores the error.
Code:
On Error Resume Next
Set Rs = connDB.Execute(Qstr)
If Err.Number > 0 Then MsgBox "Bla bla etc"
Any suggestions?