Solved

Access 2010 field to add date and time a field had data entered

Posted on 2014-02-23
2
744 Views
Last Modified: 2014-02-28
I would like for the database to have a field that provides me with the User, Date and Time a field is updated.

I do have a login screen and password that are used to enter the database by each person.

The field where data is entered would be like "StatementDate" or "StartDate" or "CompletedDate".
0
Comment
Question by:NNiicckk
2 Comments
 
LVL 22

Accepted Solution

by:
Kelvin Sparks earned 250 total points
ID: 39881536
I'm not sure about the user without knowing if you trap the user details when they log on.

For the date and time, have hidden (or visible) fields for Date and time, and using the before update event on the fields you want to to capture the details for,

Use Me.DateUpdated = Date() and me.TimeUpdated = Time()
If you have captured the user - do much the same for the user.


Kelvin
0
 
LVL 34

Assisted Solution

by:PatHartman
PatHartman earned 250 total points
ID: 39882934
If you simply want to log the last time a record was updated and by whom, add something like the following to the FORM's BeforeUpdate event.

Me.UpdateBy = Environ("UserName")  
Me.UpdateDT = Now()

If your users log in, use their log in name rather than the environ() variable.

If you want to log every change to every field and keep it historically, that is a much bigger job and you'll need to think about how you will actually use that information.  There are a number of methods and you should find examples for them if you search.
1. Log the entire record with the before and after image.  This requires a separate log table for each active table.
2. Log only the after images.  This also requires a separate log table for each active table but is the simplest method to implement since it only required copying the current record to the log table by running an append query in the FORM's AfterUpdate event.
3. Log before and after images of each field.  This could be done in one table but you have to decide how you are going to handle the various data types.  Will you save everything as a memo to accommodate the largest data type or will you have several columns in the table and populate the one that matches the data type of the field being saved.
4. Similar to 3 but log only the after image.

Post back when you have firmer requirements.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now