date stamp Can I add a date stamp in a Text or Memo Field

date stamp Can I add a date stamp in a Text or Memo Field

Post by TWljaGFlbC » Wed, 06 Apr 2005 08:13:01


Can I add a date stamp (and or a User stamp) in a Text or Memo Field when a
user updates my notes field (Memo)
 
 
 

date stamp Can I add a date stamp in a Text or Memo Field

Post by Ken Snell » Wed, 06 Apr 2005 08:31:07

If you are asking, "can I concatenate the value of the current date and time
into a text field's contents" (or memo field's contents), the answer is yes.

--

Ken Snell
<MS ACCESS MVP>

 
 
 

date stamp Can I add a date stamp in a Text or Memo Field

Post by TWljaGFlbC » Wed, 06 Apr 2005 09:23:02

Can you point me in the dircection of any examples or code that could help
me. Thanks,
 
 
 

date stamp Can I add a date stamp in a Text or Memo Field

Post by Ken Snell » Wed, 06 Apr 2005 11:08:14

In which context would you be doing this?

As an example, the following code step would add the current date and time
to a control on a form:

Me.ControlName.Value = Me.ControlName.Value & vbCrLf & _
Format(Now(), "dd mmm yyyy at hh:nn:ss ampm")

--

Ken Snell
<MS ACCESS MVP>
 
 
 

date stamp Can I add a date stamp in a Text or Memo Field

Post by Ken Snell » Wed, 06 Apr 2005 12:27:39

Note that the vbCrLf that I put in the code is not a requirement - I
included it only as a "separator" for the date/time stamp. Also, the Format
"format" ("dd mmm yyyy at hh:nn:ss ampm") that I provided can be changed to
other options.
--

Ken Snell
<MS ACCESS MVP>
 
 
 

date stamp Can I add a date stamp in a Text or Memo Field

Post by John Vinso » Wed, 06 Apr 2005 13:37:00

On Mon, 4 Apr 2005 16:13:01 -0700, Michael L <Michael



As Ken says - you can; but you *shouldn't*. Fields should be atomic. A
text note and a timestamp are two different pieces of information!

Might you consider adding a Date/Time field (default value Now()) to
your table, so that when a record (including a note) is entered the
time that it was entered is automatically retained, just in a
different field?

John W. Vinson[MVP]
 
 
 

date stamp Can I add a date stamp in a Text or Memo Field

Post by bWRhdmlkam » Sun, 10 Apr 2005 05:51:02

The Date/Time field with the Now() default works great for indicating when a
record is entered. But how would you implement a "Date Last Changed"
Date/Time field that would change to Now() whenever anything in the record is
changed? I suspect it might be based on the BeforeUpdate event but I can't
find anything on the actual mechanics of it.
 
 
 

date stamp Can I add a date stamp in a Text or Memo Field

Post by John Vinso » Sun, 10 Apr 2005 08:12:50

On Fri, 8 Apr 2005 13:51:02 -0700, "mdavidjohnson"



Quite correct. Something like this in the Form's BeforeUpdate:

Private Sub Form_BeforeUpdate(Cancel as Integer)
<put any validation code here, set Cancel to True and exit if there is
a validation error>
<if all is well...>
Me!DateLastChanged = Now
End Sub

John W. Vinson[MVP]
 
 
 

date stamp Can I add a date stamp in a Text or Memo Field

Post by bWRhdmlkam » Tue, 12 Apr 2005 09:03:03

That worked fine. Thank you.

But suppose I go in and change something directly in a table without using a
form. Is there any way to ensure that the "Date Last Changed" field gets
updated then too?
 
 
 

date stamp Can I add a date stamp in a Text or Memo Field

Post by Rick Brand » Tue, 12 Apr 2005 10:17:14


Nope. Not unless you use a server database that supports triggers for the back
end.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
 
 
 

date stamp Can I add a date stamp in a Text or Memo Field

Post by John Vinso » Tue, 12 Apr 2005 10:29:56

On Sun, 10 Apr 2005 17:03:03 -0700, "mdavidjohnson"



No.

John W. Vinson[MVP]