S
sara
I am trying Allen's code from his web site to audit
changes and I have a few problems. Dim db As
DAO.Database didn't compile, so I searched and found that
I had to go into VBA module, Tools, References and check
Microsoft DAO 3.6 Object Library. Maybe I need something
else too?
But the code isn't working for me to audit changes (I'm
not auditing Deletes and Inserts)
1. I NEVER got the "Edit TO" record. I get the AutoNum
in the auditTable (key) as 1,3,5,7 (missing the 2,4,6,8
which would be the "Edit TO" records.
2. I got some "Edit From" records, but not consistently. I
had tried to capture "ChangeDate" with the record (for
reporting, queries), and was having trouble with that. I
wanted the form to say "ChangeDate Default Value =Date()"
but that didn't update the table. So, I put an Update
Query in the code when the user presses "Save my Changes"
to put the Change date in. (I was told it's better to do
this in the form, but I can't get that to work).
Now I'm getting ChangeDate all the time in my table, which
is good. But I ONLY get the "Edit From" record. And If I
Edit the SAME record twice, I don't get the second (or
third, etc) "Edit From" record. But when I do edit
another record, the AutoNum Key in the Audit table is
incremented by 4 (showing that the table "knew" about the
others, but didn't write them).
Background:
I have a main form and subform. The user selects the
record to edit and clicks "Update record" which brings up
the "frmUpdateRecord". When done, the user chooses "Save
my Changes" button (or Undo or Close without Save). I
have the Save Record code with the Click Event of
the "Update Record" button. Perhaps this is in conflict
with the Before Update and After Update events recommended
in Allen's code?
Thanks - this is one of the last steps for me to show this
application to our President (a real techno-phobe who
doesn't believe all this CAN be done!)
Sara
changes and I have a few problems. Dim db As
DAO.Database didn't compile, so I searched and found that
I had to go into VBA module, Tools, References and check
Microsoft DAO 3.6 Object Library. Maybe I need something
else too?
But the code isn't working for me to audit changes (I'm
not auditing Deletes and Inserts)
1. I NEVER got the "Edit TO" record. I get the AutoNum
in the auditTable (key) as 1,3,5,7 (missing the 2,4,6,8
which would be the "Edit TO" records.
2. I got some "Edit From" records, but not consistently. I
had tried to capture "ChangeDate" with the record (for
reporting, queries), and was having trouble with that. I
wanted the form to say "ChangeDate Default Value =Date()"
but that didn't update the table. So, I put an Update
Query in the code when the user presses "Save my Changes"
to put the Change date in. (I was told it's better to do
this in the form, but I can't get that to work).
Now I'm getting ChangeDate all the time in my table, which
is good. But I ONLY get the "Edit From" record. And If I
Edit the SAME record twice, I don't get the second (or
third, etc) "Edit From" record. But when I do edit
another record, the AutoNum Key in the Audit table is
incremented by 4 (showing that the table "knew" about the
others, but didn't write them).
Background:
I have a main form and subform. The user selects the
record to edit and clicks "Update record" which brings up
the "frmUpdateRecord". When done, the user chooses "Save
my Changes" button (or Undo or Close without Save). I
have the Save Record code with the Click Event of
the "Update Record" button. Perhaps this is in conflict
with the Before Update and After Update events recommended
in Allen's code?
Thanks - this is one of the last steps for me to show this
application to our President (a real techno-phobe who
doesn't believe all this CAN be done!)
Sara