G
Guest
I have a main table, and a form a user can use to modify records in the main
table. When a user modifies a record, I want to get the pre-update
(BeforeUpdate) data copied into a backup table with one more field (date of
update). This will serve as a simple audit log. Here is how I have it thus
far:
Private Sub Form_BeforeUpdate()
Dim db As Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Models_Change_Backup")
rs.AddNew
rs![ChangeDate] = Now
<NEED HELP HERE>
rs.Update
End Sub
In the <NEED HELP HERE> section, I'd like to have something like rs!* = Me!*
to copy all of the data from the current record to the new row of the backup
table. Keep in mind the new table has one more column, which is why I have
the rs![ChangeDate] = Now line.
Any thoughts on a quick way to copy the 100 fields without writing 100 lines
of code?
Thanks!
Andrew
table. When a user modifies a record, I want to get the pre-update
(BeforeUpdate) data copied into a backup table with one more field (date of
update). This will serve as a simple audit log. Here is how I have it thus
far:
Private Sub Form_BeforeUpdate()
Dim db As Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Models_Change_Backup")
rs.AddNew
rs![ChangeDate] = Now
<NEED HELP HERE>
rs.Update
End Sub
In the <NEED HELP HERE> section, I'd like to have something like rs!* = Me!*
to copy all of the data from the current record to the new row of the backup
table. Keep in mind the new table has one more column, which is why I have
the rs![ChangeDate] = Now line.
Any thoughts on a quick way to copy the 100 fields without writing 100 lines
of code?
Thanks!
Andrew