?
Solved

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

Posted on 2014-02-23
2
Medium Priority
?
756 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 1000 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 39

Assisted Solution

by:PatHartman
PatHartman earned 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

649 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