Need help desperately, Problem Generating Errors for currentdb.execute

  • Thread starter Thread starter zippy
  • Start date Start date
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
 
Problem is I cannot see the error being generated. How or what am I am
missing that is preventing the error message from printing.

This is done in access and I kinda do not want to do transactional
approach as this is a simple DB. I just cannot for the life of me figure
out why access will not return an error when the insert statemtn fails
because of duplicate keys.

It actully returns no errors, the system acts like it worked but when I
look in the table, the data is not there. So is my error control wrong?
 
Back
Top