Audit Trail question

  • Thread starter Thread starter mynews
  • Start date Start date
M

mynews

Here's the setup:

I have a database with 10 tables, each with an associate form for data
entry. I have a module with a public function called "AuditData()". In
each table, is a memo field called "Updates". In each corresponding
form is a bound text box, linking to the Updates field in each table.
The bound control is locked.

In the BeforeUpdate event of each form is the following command:

=AuditData()

the AuditData function iterates thru each control on the form, and, if
the data has changed (including additions & deletions), the
information is stored to the Updates field in the table.

Here's the problem:

It works fine on one table - every time a change is made on any
control on the form, the info is updated in the underlying table.
However, on the other forms/tables, I get nothing. No error messages,
just nothing shows up in the Updates memo field. I've double-checked
that the object names are correct, and the bound text box references
the correct field.

Here's another wrinkle - I took the form that DOES work correctly, and
copied all the controls to a new, blank form. I then attached that new
form to one of the table that wasn't reading the Updates. It now
works.

What might I have done wrong, or do you have any ideas on what I might
check? I can post the module code if it helps, but that seems to work
fine, since it works on the one (now two!) tables/forms.

Grateful for any guidance!

C
 
Hi C

Have you set a breakpoint in your code and stepped through it to see what is
happening?

Are you using On Error Resume Next to ignore errors? It's possible that an
error is occurring silently and you're not being informed.

Incidentally, you might find the memo field method of audit trailing gets a
bit unwieldy and unworkable when you actually want to trace back changes to
particular data. A common method is to create a separate Audit table with
fields for date/time, form name, field name, old value, new value, user
name, etc.

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
 
Back
Top