View Single Post
  #16  
Old November 26th, 2006, 01:25 AM posted to microsoft.public.access.forms
John Vinson
external usenet poster
 
Posts: 4,033
Default Date stamp a notes field

On Sat, 25 Nov 2006 22:14:02 GMT, "arogers via AccessMonster.com"
u29179@uwe wrote:

I'm sorry Douglas I have explained exactly what I would like to do right from
the very start and I will repeat :
( arogers - 11-17-2006 21:22 )

How can I add a current Date/Time stamp to my Notes field (Memo) each time I
add data to the field and ensure the most recent Date/Time is always at the
top of the field. (Access 97) ) I dont think it could be any more basic than
that! and I think you will see from the threads that I have (Bothered) to
answer various people who have tried to help and I appreciate all the help
and advice given so far.


Have you *intentionally rejected* the normalized solution, using a
Notes table related one to many to this table? This could have a
date/time field defaulting to Now(), a foreign key to your main table,
and a Text or Memo field for the note; you could display it in reverse
chronological order in a subform/subreport; you could much more easily
search for a note based on a date/time range or vice versa. Having all
of the notes and dates jammed together in a single memo field makes it
much harder to search, especially if you want to associate a note with
its date!

If you REALLY want it this way anyhow, you'll need to update the field
in VBA code; e.g. have two textboxes, txtMemo bound to the memo field
and txtNewNote, unbound. In your code you could use

Private Sub txtNewNote_AfterUpdate()
Dim strNew As String
strNew = GetUserID & " - " & Format(Now, "mm-dd-yyyy hh:nn") & vbCrLf
strNew = strNew & Me!txtNewNote & vbCrLf
strNew = strNew & Me!txtMemo

Me!txtMemo = strNew

End Sub

John W. Vinson[MVP]