Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2007

Tip: Looking for answers? Try searching our database.

Allen Browne Audit Log - EditTo problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kirk P. - 03 Mar 2007 15:28 GMT
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.
Kirk P. - 03 Mar 2007 15:52 GMT
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.  

> 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.  
[quoted text clipped - 10 lines]
> thus no record is appended.  The primary key in audSourceData is an
> autonumber field called audID.  
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.