Introfield
Instructor
I need to compare (ona daily basis) how many records are updated by my users. I've found some code that will insert a new record in a separate table whenever changes are made. However, I cant get it to go past the line:
Dim db As Database
The process looks like this...
Use the AfterUpdate event of the form, to insert a new record in the tblStudentChanges table, whenever a change is made.
Private Sub Form_AfterUpdate()
Dim db As Database
Set db = CurrentDb
db.Execute "INSERT INTO [tblStudentChanges] " _
& " SELECT * FROM [tblStudent] WHERE " _
& " [tblStudent].[StudentID]=" & Me![StudentID] & ";"
Set db = Nothing
End Sub
Dim db As Database
The process looks like this...
Use the AfterUpdate event of the form, to insert a new record in the tblStudentChanges table, whenever a change is made.
Private Sub Form_AfterUpdate()
Dim db As Database
Set db = CurrentDb
db.Execute "INSERT INTO [tblStudentChanges] " _
& " SELECT * FROM [tblStudent] WHERE " _
& " [tblStudent].[StudentID]=" & Me![StudentID] & ";"
Set db = Nothing
End Sub