Solved

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

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

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

831 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