Inserting Date/Time stamp in a memo field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am wanting to put a date/time stamp in a memo field everytime someone updates it. I Would also like the cursor to return to the beginning of the field. Thanks for any help.
 
You might want to consider creating a new table with 4 fields.
Primary key
Date/time
Individual updating
Comment
This will allow for more flexibility in the future. It
also allows for the locking of previous comments.

Jim

-----Original Message-----
I am wanting to put a date/time stamp in a memo field
everytime someone updates it. I Would also like the cursor
to return to the beginning of the field. Thanks for any help.
 
Thanks for the response. I have 3 forms with memo fields that will be updated numerous times a day. I am new to access and was told there is a vb code to do this. I really dont know what would be easier.
 
I dont know if I was clear at first but I want the date/time stamp to remain after every update (to keep track of all updates to the field)

If you want the date and time and the newest entry at the beginning of
the field, then Code the Control's Enter Event:
Me![ControlName].SelStart = 0

Then code the Control's AfterUpdate event:
Me![ControlName] = Now & " " & Me![ControlName]

The data will look like this:
4/26/2004 1:30:00 PM This is the text of the newest memo.
4/18/2004 9:30:25 AM This is a previous memo.

If you want the newest entry and time at the end of the field, then
code the respective events:
Me![ControlName].SelStart = len(Me![ControlName])
and
Me![ControlName] = Me![ControlName] &" " & Now
 
Thanks it works great. Is there a way I can skip a line between updates. I really appreciate it.
 
Thanks again for all the help. I tried the code and it didnt work. Maybe I should explain everything better. I have a memo field in a form. When I tab to the memo field I want it to start on the first line. After the update I want a time/date stamp. When the next user goes to the memo field I want it to start at the top again with the last update and time/date stamp to be below it with a space between the time/date stamp and the message typed. Sorry if I confused everyone but I am new to access.
 
Thanks it works great. Is there a way I can skip a line between updates. I really appreciate it.

Sure, but I don't know whether you want the new entries at the
beginning or at the end of the field.

Code the After Update event to either:

At the Beginning ...
Me!ControlName = vbNewLine & Now & " " & Me!ControlName
or
At the end ....
Me!ControlName = Me!ControlName & " " & Now & vbNewLine

Or add a line between the text and the date:
=Me.ControlName & vbNewLine & Now
etc.
 
Thanks for all the help. It appears that it is now stamping after update and when I hit the save button. The text is also disappearing. Any clues?
 
Thanks for all the help. It appears that it is now stamping after update and when I hit the save button. The text is also disappearing. Any clues?

Place the Control's AfterUpdate code in with the Save record code
instead.

Are you sure the text is diappearing?
Look in the table and see what you have there.
Perhaps it's just because you have line spaced and the text moved up
in the control.
 
How about Storing the comments in a text (or memo field if the size extends
255 chars), have a seperate field for the date & user stamp
& simply display the concatinated result in an (unbound) memo field for
people to read the "whole story"? - no edit possibility on old entries -
just add new...

Pieter


and when I hit the save button. The text is also disappearing. Any clues?
 
Back
Top