S
Steve G
Hi All:
Someone was kind enough to provide the following code for me to use in a
form so I could track changes made to a field in our database. I now need to
track multiple field changes made at the same time. Such as: status and
statud description changes. (two separate fields). Is it possible to modify
this code to do that?
Private Sub PatientStatus_AfterUpdate()
Dim dbsPatients As Database
Dim rstTrackingChanges As DAO.Recordset
Dim theCurrentUser As String
NewValue = PatientStatus.Value
Set dbsPatients = CurrentDb
Set rstTrackingChanges = dbsPatients.OpenRecordset("tblTrackingChanges")
theCurrentUser = CurrentUser
rstTrackingChanges.AddNew
rstTrackingChanges!PatientNo = thePatientNo
rstTrackingChanges!ModPastValue = OldValue
rstTrackingChanges!ModNewValue = NewValue
rstTrackingChanges!ModUser = theCurrentUser
rstTrackingChanges.Update
End Sub
If not, any ideas how I might do this?
TIA
Steve G
Someone was kind enough to provide the following code for me to use in a
form so I could track changes made to a field in our database. I now need to
track multiple field changes made at the same time. Such as: status and
statud description changes. (two separate fields). Is it possible to modify
this code to do that?
Private Sub PatientStatus_AfterUpdate()
Dim dbsPatients As Database
Dim rstTrackingChanges As DAO.Recordset
Dim theCurrentUser As String
NewValue = PatientStatus.Value
Set dbsPatients = CurrentDb
Set rstTrackingChanges = dbsPatients.OpenRecordset("tblTrackingChanges")
theCurrentUser = CurrentUser
rstTrackingChanges.AddNew
rstTrackingChanges!PatientNo = thePatientNo
rstTrackingChanges!ModPastValue = OldValue
rstTrackingChanges!ModNewValue = NewValue
rstTrackingChanges!ModUser = theCurrentUser
rstTrackingChanges.Update
End Sub
If not, any ideas how I might do this?
TIA
Steve G