Z
zippy
Below is some code for doing and insert into one of my tables. The
inserts do not work because a duplicate key exists, which I want to
happen. The problem is, I cannot get access to return an error for this
condition.
What can I do to get access to return an error on my query?
Thanks
-------------------------------
CODE
-------------------------------
On Error GoTo sql_error_err
Set Mydb = CurrentDb
Mydb.Execute sql, dbFailOnError
sql_error_exit:
Exit Sub
sql_error_err:
MsgBox Err.Number
MsgBox Err.Description
Debug.Print Err.Description
Debug.Print Err.Description
Debug.Print Err.Source
Resume sql_error_exit
--
Scott Baust
EZDataLink
3200 NE 14th Street Ste 200
Pompano Beach, FL 33062
954-781-9211
inserts do not work because a duplicate key exists, which I want to
happen. The problem is, I cannot get access to return an error for this
condition.
What can I do to get access to return an error on my query?
Thanks
-------------------------------
CODE
-------------------------------
On Error GoTo sql_error_err
Set Mydb = CurrentDb
Mydb.Execute sql, dbFailOnError
sql_error_exit:
Exit Sub
sql_error_err:
MsgBox Err.Number
MsgBox Err.Description
Debug.Print Err.Description
Debug.Print Err.Description
Debug.Print Err.Source
Resume sql_error_exit
--
Scott Baust
EZDataLink
3200 NE 14th Street Ste 200
Pompano Beach, FL 33062
954-781-9211