BlueSpruce
Well-known member
- Local time
- Today, 07:52
- Joined
- Jul 18, 2025
- Messages
- 1,078
Every time users update any information about a customer, in the form's after update event I am appending a copy of the customer record with the date/time the change was made, and the user who made the change to a customer history table. However, when a new customer is first added, it's also appending that record to the history table. What is the best way to prevent that initial record from being added to the history table?
Code:
Private Sub Form_AfterUpdate()
On Error GoTo locErrorHandler
cmdSave.Transparent = True
cmdUndo.Transparent = True
CurrentDb.Execute "qryCustomerHistory_AppendAfterChange", dbSeeChanges
lstCustomerHistorySIID.Requery
lstCustomerHistorySIID = lstCustomerHistorySIID.ItemData(0)
DisplayCaption_HistoryTab
txtDisplayCustomer.Requery
locExitHere:
Exit Sub
locErrorHandler:
ErrorHandler Me.Name, "Form_AfterUpdate"
If gErrorResponse = 1 Then Resume
If gErrorResponse = 2 Then Resume Next
Resume locExitHere
End Sub