A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Time Stamp



 
 
Thread Tools Display Modes
  #1  
Old January 22nd, 2010, 04:48 PM posted to microsoft.public.access.forms
Adam
external usenet poster
 
Posts: 545
Default Time Stamp

How can I automatically populate the current date into a field for a new
record? Will this automation apply a new date to all records?
  #2  
Old January 22nd, 2010, 05:01 PM posted to microsoft.public.access.forms
Darrell Childress[_3_]
external usenet poster
 
Posts: 32
Default Time Stamp

Adam wrote:
How can I automatically populate the current date into a field for a new
record? Will this automation apply a new date to all records?


Set the default value to be Date(). This is done in the table design
view. You can, obviously, set the format in the field to show only date,
or date and time if you need to know the time of day the record was added.
  #3  
Old January 22nd, 2010, 09:38 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Time Stamp

Darrell's suggestion will work just fine, of course, but just so that you
know how to differentiate between new records and old records when doing
something like this, you could also have used

Private Sub Form_Current()
If Me.NewRecord Then
Me.TimeStamp = Date
End If
End Sub

and only the new records would have been effected, with the existing records
retaining their original creation timestamps.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201001/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.