Hi all,
Am looking for advice regarding a very odd problem..
Our booking system is an Access 2003 front end on a SQL Server 2000 (I know..!) back-end.
Our finance department have asked us to implement an auditing solution to enable them to track changes in key tables. I've implemented this using a combination of INSERT, UPDATE and DELETE triggers which write details of changed records to audit tables (with unique IDs for each change).
This is all working fine for most of the tables which are being audited but following the changes I'm experiencing problems with one particular table with regard to the access front end.
This relates to a subform of the main booking form which has an embedded button to create a new record in one of the tables which is being audited (using DoCmd.GotRecord,,acNewRec). On clicking this a new record is being created, and the trigger is fired to create a new record in the audit table.
The odd thing is that rather than going to a new record in the subform, access is actually taking the user to a completely unrelated record.
On investigation I've discovered that the record that the user is taken to has a primary key which matches the unique ID of the newly created record in the audit table, rather than the source table.
eg
Form is bound to Credits table
Click to enter new record
New record is created in the Credits table with CreditID (PK) of 2668.
New record is created in the AUDIT_Credits table with an AuditID (PK) of 81 detailing the insertion of Record ID 2668.
Access moves focus of form to CreditID 81 rather than 2668
...so I conclude that Access is somehow picking up the ID of the audit record rather than that of the "source" record and shifting the focus of the form accordingly.
This is the first time I've come across this issue in all the years I've been using Access. Really stumped and would be grateful for any advice.
Thanks
Jon
Am looking for advice regarding a very odd problem..
Our booking system is an Access 2003 front end on a SQL Server 2000 (I know..!) back-end.
Our finance department have asked us to implement an auditing solution to enable them to track changes in key tables. I've implemented this using a combination of INSERT, UPDATE and DELETE triggers which write details of changed records to audit tables (with unique IDs for each change).
This is all working fine for most of the tables which are being audited but following the changes I'm experiencing problems with one particular table with regard to the access front end.
This relates to a subform of the main booking form which has an embedded button to create a new record in one of the tables which is being audited (using DoCmd.GotRecord,,acNewRec). On clicking this a new record is being created, and the trigger is fired to create a new record in the audit table.
The odd thing is that rather than going to a new record in the subform, access is actually taking the user to a completely unrelated record.
On investigation I've discovered that the record that the user is taken to has a primary key which matches the unique ID of the newly created record in the audit table, rather than the source table.
eg
Form is bound to Credits table
Click to enter new record
New record is created in the Credits table with CreditID (PK) of 2668.
New record is created in the AUDIT_Credits table with an AuditID (PK) of 81 detailing the insertion of Record ID 2668.
Access moves focus of form to CreditID 81 rather than 2668
...so I conclude that Access is somehow picking up the ID of the audit record rather than that of the "source" record and shifting the focus of the form accordingly.
This is the first time I've come across this issue in all the years I've been using Access. Really stumped and would be grateful for any advice.
Thanks
Jon