Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / April 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael L - 05 Apr 2005 00:13 GMT
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)
Ken Snell [MVP] - 05 Apr 2005 00:31 GMT
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.

Signature

       Ken Snell
<MS ACCESS MVP>

> 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)
Michael L - 05 Apr 2005 01:23 GMT
Can you point me in the dircection of any examples or code  that could help
me.  Thanks,

> 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.
>
> > 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)
Ken Snell [MVP] - 05 Apr 2005 03:08 GMT
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")

Signature

       Ken Snell
<MS ACCESS MVP>

> Can you point me in the dircection of any examples or code  that could
> help
[quoted text clipped - 9 lines]
>> > a
>> > user updates my notes field (Memo)
Ken Snell [MVP] - 05 Apr 2005 04:27 GMT
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.
Signature


       Ken Snell
<MS ACCESS MVP>

> In which context would you be doing this?
>
[quoted text clipped - 17 lines]
>>> > a
>>> > user updates my notes field (Memo)
John Vinson - 05 Apr 2005 05:37 GMT
>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)

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]    
mdavidjohnson - 08 Apr 2005 21:51 GMT
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.

> >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)
[quoted text clipped - 8 lines]
>
>                   John W. Vinson[MVP]    
John Vinson - 09 Apr 2005 00:12 GMT
>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.

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]    
mdavidjohnson - 11 Apr 2005 01:03 GMT
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?

> >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"
[quoted text clipped - 12 lines]
>
>                   John W. Vinson[MVP]    
Rick Brandt - 11 Apr 2005 02:17 GMT
> 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?

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

Signature

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

John Vinson - 11 Apr 2005 02:29 GMT
>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?

No.

                 John W. Vinson[MVP]    
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.