Craig:
Below is a sample of the code I'm using. I don't know a lot about developing code, so I generally find what I can on the internet, which is where I found this. What happens is a temp database is created every time a form is opened, and the changes are saved to the temp table. Once the changes are confirmed, they are moved to the audit table, and deleted from the temp table. I'm not quite sure how to incorporate the after_upate event for the cmd buttons into this.
Option Compare Database
Option Explicit
Const txtTableName = "FacultyEffort"
Dim Subsumed_EffortOldValue As Variant
Dim cmdStartDateOldValue As Variant
Dim cmdEndDateOldValue As Variant
Private Sub Subsumed_Effort_BeforeUpdate(Cancel As Integer)
WriteAuditUpdateToTemp txtTableName, Me.EntryID, "Subsumed Effort", Me.[Subsumed Effort].OldValue, Me.[Subsumed Effort].Value
End Sub
Private Sub cmdStartDate_BeforeUpdate(Cancel As Integer)
WriteAuditUpdateToTemp txtTableName, Me.EntryID, "cmdStartDate", Me.cmdStartDate.OldValue, Me.cmdStartDate.Value
End Sub
Private Sub cmdEndDate_BeforeUpdate(Cancel As Integer)
WriteAuditUpdateToTemp txtTableName, Me.EntryID, "cmdEndDate", Me.cmdEndDate.OldValue, Me.cmdEndDate.Value
End Sub
WriteAuditUpdateToTemp txtTableName, EntryIDOldValue, "Subsumed Effort", Subsumed_EffortOldValue, "#Deleted#"
WriteAuditUpdateToTemp txtTableName, EntryIDOldValue, "cmdStartDate", cmdStartDateOldValue, "#Deleted#"
WriteAuditUpdateToTemp txtTableName, EntryIDOldValue, "cmdEndDate", cmdEndDateOldValue, "#Deleted#"
WriteAuditUpdateToTemp txtTableName, EntryIDOldValue, "", "", "RecordDeleted"
Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
WriteAuditUpdateToTemp txtTableName, EntryIDOldValue, "Subsumed Effort", Subsumed_EffortOldValue, "#Deleted#"
WriteAuditUpdateToTemp txtTableName, EntryIDOldValue, "cmdStartDate", cmdStartDateOldValue, "#Deleted#"
WriteAuditUpdateToTemp txtTableName, EntryIDOldValue, "cmdEndDate", cmdEndDateOldValue, "#Deleted#"
WriteAuditUpdateToTemp txtTableName, EntryIDOldValue, "", "", "RecordDeleted"
Private Sub Form_Delete(Cancel As Integer)
Subsumed_EffortOldValue = Me.Subsumed_Effort.OldValue
cmdStartDateOldValue = Me.cmdStartDate.OldValue
cmdEndDateOldValue = Me.cmdEndDate.OldValue
End Sub
Thanks.
Jennifer