Sub - tracking record changes

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
 

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