Date Stamp on MSAccess XP Table (1 Viewer)

Victoria

New member
Local time
Today, 06:37
Joined
Apr 20, 2003
Messages
5
My office has asked me to add a date field to their table which changes each time any field in that specific record is edited. We are running Access XP. Is there a way? Your help is appreciated.:)
 

Jack Cowley

Registered User.
Local time
Today, 11:37
Joined
Aug 7, 2000
Messages
2,639
This is an Access2000 article but it will do what you want. Click here to be taken to the article....

hth,
Jack
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:37
Joined
Feb 19, 2002
Messages
43,223
Jet does not support triggers so the only way to do this when your back end tables are Access, is through a form. If your backend db is something else such as SQL server, you should use a trigger. If the Audit Trail article that Jack found for you is more than you want, you can just add a new column to the table and call it LastUpdateDt. Then in the BeforeUpdate event of any form that updates the table add a single line of code:

Me.LastUpdateDt = Now()

The field does not need to be displayed on the form but it does need to be in the form's recordsource. So don't forget to add the new column to the query used as the form's recrodsource. If the form doesn't recognize the new field you will need to force the form to refresh its fields collection. To do this, delete the query name from the form's recordsource, save the form, and the just put the query name back into the recordsource.
 

Friday

Registered User.
Local time
Today, 11:37
Joined
Apr 11, 2003
Messages
542
I use what Pat is referring to a lot on my apps. We are constantly being bombarded with "I never got that last update". So (with the help of people on this forum) I built an event log. It's simply another field in the table that is populated at record change time. It graps the date and time, the user id and the printer destination, strings it together and populates the event_log field with it...

"This record was updated 04/20/2003 at 15:03 hours by b450934 and printed to lp900345."

Then I built a report off that, and keyed it to a place on the form. When my boss insists 'so-and-so never got this update', I can prove our innocence (or guilt).
 

Benny Wong

Registered User.
Local time
Today, 03:37
Joined
Jun 19, 2002
Messages
65
Audit Trail

Hello Friday,
I am also using Access 2000. I am interested in what you did on the audit feature of capturing the user's updates to the
records and the printer output.
My question is how do you capture the user name, and the name of the printer in which the user output? Currently, I have not impose Access User Security nor does the Management want it but I want to cover my behind if you know what I mean.
I appreciate it if you could help me I am a beginner in VBA, but the fields have been built just need the code if any to implement. Thanks for your help in advance. Thanks for your time.
 

Friday

Registered User.
Local time
Today, 11:37
Joined
Apr 11, 2003
Messages
542
First, I am using 97, but I have converted most of my stuff to XP anticipating a change in the near future, and it works. I grab the users ID from the Windows registry, using some code that is rather lengthy, look at this thread The printer part is tricky and may not be available to most. Here at work we have two email systems. One is an older mainframe implementation called EMC2. All the companies printers are defined here. We mainly use Outlook mail, and you can have EMC2 printers defined in Outlook. I have a listbox that shows each station name and the printer associated with it. This is a multi-select list box that allows the user to select as many destinations as he wants the file to go to. When the user click the 'Send' button, I have some SendObject code behind the button that creates the Outlook message from data on the form and sends it to the printers selected. The printers are actually Outlook addresses. At the same time, The values in the list box that were selected are captured, along with the users ID and the date. This is the data I use to create the event log.
 

Users who are viewing this thread

Top Bottom