Solved

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

Posted on 2014-02-23
2
747 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

939 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

10 Experts available now in Live!

Get 1:1 Help Now