How to handle change in a cell, made by another user

R

Rod

Please help! Several users have access to the same
database. A user changed a cell in a table.The admin need
to be informed about that change. Is there an event
(something like OnCellChange) which occurs, when a cell
changes? I didn't find any usefull events in Access help
(only event , which aplies to forms or controls, but not
to tables)
 
J

Jeff Boyce

Rod

Access tables do not have "triggers" or any other events. Why are the users
directly accessing the tables? Usually, forms are used to better manage
data entry/maintenance.

Have you checked in the security newsgroup? Be aware that invoking security
in Access brings a whole new level of design and maintenance.

By the way, Excel has cells, Access does not. The tables in Access have
columns, or fields, and while it might look like a spreadsheet, an Access
table is not.

Good luck!

Jeff Boyce
<Access MVP>
 
R

Rod

Thank you!
But i didn't say that users change table directly. Of
course they do it by forms.
The only thing I want to achive is to track changes to
tables in realtime. A user on one PC changes a field, on
another PC, Access shows a messagebox that data was
changed.
How to create such thing? Can Access react on data change?
There is nothing useful in Security NewsGroup about it.
 
J

Jeff Boyce

Rod

My mistake -- your post said "A user changed a cell in a table".

Since you are using forms, check the AfterUpdate event and the .OldValue
property as ways to track changes. However, Access, unlike SQL-Server, does
NOT have a transaction log. If you use Access for your data store (i.e.,
back-end), you'll have to create your own mechanism to track all changes.

If you simply wish to know who last "touched" a record, that's much simpler
to implement. Add a pair of fields to each table you wish this for. One
will hold the ID of the person, the other the datetime of change. You'll
need to add a way to get the person's ID.

In the form's BeforeUpdate event, set the value of the ChangedBy field to
the person's name or ID, and the value of the ChangedAt field to Now() (date
& time).

By the way, your original post also mentioned an error message, advising
User2 that the field had already been changed. Check Access HELP on the
topic of Record Locking, too.

Good luck!

Jeff Boyce
<Access MVP>
 

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