Allen Browne Audit Log - EditTo problem

G

Guest

I've successfully used this code in several db's, but for whatever reason,
the db I'm working on now is have a problem inserting the "EditTo" records.
It just won't create EditTo records in the audit table.

I've determined the problem is in the append query. Here's the SQL the
function generates for the EditTo process:

INSERT INTO audSourceData ( audType, audDate, audUser ) SELECT 'EditTo' AS
Expr1, Now() AS Expr2, NetworkUserName() AS Expr3, tblSourceData.* FROM
tblSourceData WHERE (tblSourceData.RecID = 35004);

The problem is, I'm getting a primary key violation when this query runs,
thus no record is appended. The primary key in audSourceData is an
autonumber field called audID.
 
G

Guest

NEVER MIND!!

It's amazing what can occur to you when you just walk away from the problem.
I had several indexes other than the primary key defined in the Audit table.
Deleting those indexes solved the problem - just like Allen's instructions
say to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top