Audit trail

R

rascal

I found an Article on creating an audit trail of record changes in a form in
Access 2000, Microsoft article ID 197592. It works well except for the fact
that it also tracks the fields that haven't been updated. Is there anyway
that I can get it to ignore those fields and only record the ones that have
actually changed.
Thanks
 
R

rascal

Thanks Bob:
I tried the 1 from rogersaccesslibrary.com and it worked like a charm.
However I do have 1 question. It is set up to work on text boxes and 1 field
on my form is a combo box. Any Suggestions on how to modify it to work with
the combo box also.
Other then that it records everything else that is changed or deleted from
the form.
Once again many thanks.
 
B

bobgalway

A combo box is just another object. This snippet shows how a combo bo
called cboClassification is being audited. hope it helps:

Private Sub cboclassification_BeforeUpdate(Cancel As Integer)
WriteAuditUpdate txtTableName, Me.cboAirlineNo, "clasification"
Me.cboClassification.OldValue, Me.cboClassification.Value
End Sub
'me.cboAirlineno is form source of primary key in tblmain (key
AIRLINE_NUMBER)



Private Sub Form_BeforeInsert(Cancel As Integer)
WriteAuditAddDelete txtTableName, Me.cboAirlineNo, "", "", "Ne
Record"
End Sub


Private Sub Form_Delete(Cancel As Integer)
WriteAuditAddDelete txtTableName, Me.cboAirlineNo, "", ""
"RecordDeleted"
WriteAuditUpdate txtTableName, Me.cboAirlineNo, "LegalName"
Me.txtLegalName.OldValue, "#Deleted#"
WriteAuditUpdate txtTableName, Me.cboAirlineNo, "company"
Me.txtCOMPANY.OldValue, "#Deleted#"
WriteAuditUpdate txtTableName, Me.cboAirlineNo, "lettercd"
Me.txtLETTERCD.OldValue, "#Deleted#"
WriteAuditUpdate txtTableName, Me.cboAirlineNo, "activestatus"
Me.txtActiveStatus.OldValue, "#Deleted#"
WriteAuditUpdate txtTableName, Me.cboAirlineNo, "classification"
Me.cboClassification.OldValue, "#Deleted#"
End Su
 
R

rascal

Thanks Bob:
Once again things worked well. You guys are so helpful and patient , I
really appreciate it.
Thanks
 

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