View Single Post
  #19  
Old November 27th, 2006, 06:04 PM posted to microsoft.public.access.forms
Tank
external usenet poster
 
Posts: 45
Default Date stamp a notes field

Hi Allan,

In reference to your earlier comment, “Tried it again as you suggest, with
and without the underscore. Still comes Up with a sintax error. The nearest I
have got is with:

Private Sub Notes_AfterUpdate()
Me.Notes = Me.Notes &” “& Now() & “ “
End Sub

Since your procedure above starts with “Private Sub Notes_AfterUpdate()”, I
am assuming you are abandoning the suggested use of an unbound textbox to
enter data prefaced by a date/time stamp instead of entering the data
directly into the Notes memo field, or are you saying that you just can’t get
the unbound textbox to work?

Also, are you saying that you cannot get the vbNewLine expression (or
vbCrLf, as offered by Doug) to work?

I’m wondering if your syntax problem stems from possibly these expressions
not being recognized in your Access 97 version. I do recall in years past
that vbNewLine sometimes did not work for me, so I replaced it with chr(13) &
chr(10).

There are at least three choices:

vbNewline
vbCrLf
chr(13) & chr(10)

In my earlier comments to you (11-19-06) I advised, “If vbNewLine does not
work in an application using an earlier version of Access, you might try its
equivalent, chr(13) & chr(10), which is similar to the typewriter’s carriage
return, line feed”.

I’m wondering if you had a chance to test these line feed choices to see if
one of them created the syntax error.
You might try the following:

SUBSTITUTING chr(13) & chr(10) for either vbNEWLINE or vbCRLF:

USING AN UNBOUND TEXTBOX WITH MEMO FIELD

Me.Notes = chr(13) & chr(10) & chr(13) & chr(10) & Now() & chr(13) & chr(10) _
& Me.CommentUnbound & “ “& Me.Notes
Me.CommentUnbound = vbNullString (or simply, Me.CommentUnbound = Null)


USING ONLY A MEMO FIELD FOR DIRECT DATA ENTRY

Me![Notes] = chr(13) & chr(10) & chr(13) & chr(10) & Now() _
& chr(13) & chr(10) & Me![Notes]

Another aspect to your inability to get the procedures to work may be your
form environment, as you commented recently that you are using subforms.
Although I wouldn’t think so, it’s possible your set of mainform/subforms has
methods of operation that no one can analyze via the recent Access Discussion
Group Support postings in your behalf. Perhaps on site person-to-person
guidance may be a better solution.
-----
Tank