AllExperts > Experts 
Search      

Using MS Access

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Using MS Access Answers
Question Library

Ask a question about Using MS Access
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Scottgem
Expertise
I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience
I've been designing databases for over 15 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

 
   

You are here:  Experts > Computing/Technology > Business Software > Using MS Access > Date Record Created

Topic: Using MS Access



Expert: Scottgem
Date: 6/12/2005
Subject: Date Record Created

Question
Hi Scott,

I have a field in my database that I want to show the date the record was created, with the possibility to update it to a more recent date.

How do I do that?

I'm using Access 2000
Right now expression builder says
=CDate([Ğdateğ])
but that's not working right.  

Answer
I routinely add 4 fields to my data tables; CreatedBy, CreatedWhen, EditedBy, EditedWhen.  For CreatedWhen I set the default on the table level to =Now(). For CreatedWhen I add a hidden control to my forms with a default of =fOSUserName(). Note: this functions picks up the netwrok login ID, you can find the code for this function (its not in Access) at www.mvps.org/access.

For the Edited fields, I add hidden controls to my form, and use the Before Update event of my form to run these 2 lines of code:

Me!txtEditedBy = fOSUsername()
Me!txtEditedWhen = Now()

HTH
Scott<>

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.