[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

How do I add a field to show that date the record was created in Access 2010?

I have a database that I need to add a field that will show when the record was created.  How do I do this?

Thanks.
0
mtcne
Asked:
mtcne
  • 2
1 Solution
 
Patrick MatthewsCommented:
In your table design, include a column such as CreatedDate, make the data type Date, and for the default value use =Now() if you want the date and time, or =Date() if you only want the date.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
I suggest the following
1) Create the New field in our table ... say DtRecCreated.

Then, at the Form level, use this code in the Form BeforeInsert event, which looks like this:

Private Sub Form_BeforeInsert (Cancel As Integer)
  Me![DtRecCreated] = Now()  ' Or just Date()
End Sub

I'm not a fan of putting default values on table property sheets ...

mx
0
 
mtcneAuthor Commented:
I did not mention the database already has records entered.  I am trying to determine the date created for records already entered.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Not going to happen, sorry.  There is no inherent property that tells you this, at least that is accessible.

mx
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now