Add date record created to existing records

elbowman

Registered User.
Local time
Yesterday, 18:29
Joined
Nov 10, 2011
Messages
27
Does Access programmatically add a date created to a database record, even if the dumb db developer didn't add a date created field to the form initially?

Is there a way to pull that date stamp into the existing database records? :confused:
 
Access is not smart enough to cater for all kinds of dumb db developers.

So whatever is not in the record, it's not in the record. If that field is not in the record, it's not there. If it's in the record, and set to Date/Now as default in the table design, then it's there.
 
That's what I was afraid of, Spike! Thanks!
 
You can, of course, add a Date or DateTime stamp to your Table that will document the creation date for any future records you create.

You can do it, as Spike suggested, by setting the Default for the Field, at Table level, to Date() to record only the date, or Now() to record date and time.

To do the same thing at the Form level, if you have a Textbox to display it on your Form, would do something like
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
 If Me.NewRecord Then
  Me.CreationDate = [B]Date[/B]
 End If
End Sub
For date and time, replace Date with Now.

Linq ;0)>
 
Thanks for the kind assistance.

I had figured out how to add the field going forward.

I was just hoping there was something to save me from myself in the application.

Lance
 
Putting =Now() in the Default Value property of the date field in the table will do to.
 
Yes, but sadly for Lance, nothing will work retroactively! :(

Where is H.G. Wells when you need really him? :D
 

Users who are viewing this thread

Back
Top Bottom