Solved

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

Posted on 2014-02-23
2
751 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 37

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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…

740 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