Date stamp a notes field

  • Thread starter arogers via AccessMonster.com
  • Start date
A

arogers via AccessMonster.com

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)

Thanks

Allan
 
F

fredg

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)

Thanks

Allan

Code the Notes AfterUpdate event:
Me![Notes] = Now() & vbNewLine & Me![Notes]
 
A

arogers via AccessMonster.com

Thanks,but this just lists all the dates at the top and all the data
underneath e.g
18/11/2006 00:09:38
18/11/2006 00:09:07
blah, blah,blah
dah, dah,dah

I would like it:
18/11/2006 00:09:38
dah, dah,dah
18/11/2006 00:09:07
blah, blah,blah

so the data is under each dated/time entry

Many thanks

Allan said:
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
[quoted text clipped - 3 lines]

Code the Notes AfterUpdate event:
Me![Notes] = Now() & vbNewLine & Me![Notes]
 
J

John Vinson

Thanks,but this just lists all the dates at the top and all the data
underneath e.g
18/11/2006 00:09:38
18/11/2006 00:09:07
blah, blah,blah
dah, dah,dah

I would like it:
18/11/2006 00:09:38
dah, dah,dah
18/11/2006 00:09:07
blah, blah,blah

so the data is under each dated/time entry

Might you consider normalizing this data, rather than jamming it all
into one difficult-to-search, impossible-to-sort Memo field?

If you had a Notes table with three fields (a foreign key to the
primary key of this table, a Date/Time field defaulting to Now, and a
Text or Memo field for the note), you could get the effect that you
want by using a continuous Subform.


John W. Vinson[MVP]
 
F

fredg

Thanks,but this just lists all the dates at the top and all the data
underneath e.g
18/11/2006 00:09:38
18/11/2006 00:09:07
blah, blah,blah
dah, dah,dah

I would like it:
18/11/2006 00:09:38
dah, dah,dah
18/11/2006 00:09:07
blah, blah,blah

so the data is under each dated/time entry

Many thanks

Allan said:
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
[quoted text clipped - 3 lines]

Code the Notes AfterUpdate event:
Me![Notes] = Now() & vbNewLine & Me![Notes]

Where are you adding your data? At the beginning of the text? It
should work exactly as you have requested.

If you add the data at the end of the text and expect it to move to
the top, no, it won't do that.

Code the Notes enter event:
Me.[Notes].SelStart = 0
to start at the top of the field. Always tab into the field. Don't use
the mouse for entry.

If that is too difficult for the user to handle, then add an unbound
control to the form.
Set it's AfterUpdate event to :

Me![Notes] = Now() & vbNewLine & Me![ControlName] & Me![Notes]
Me![ControlName] = Null

Set the [Notes] control's Locked property to Yes.

Use [ControlName] to enter the added text. It will then be placed at
the top of the Notes field. The user can still scroll though the text
but cannot enter the Notes control directly for editing.
 
G

Guest

Hi Allan,

Fred’s comments below are perfectly good and succinct. Here are my comments
that may help support Fred’s approach to the problem and hopefully provide
additional detailed clarification. Please forgive me if I go into some
elementary details for the sake of readers less experienced.

In Form design view, from the Toolbox bar, drag the text box icon ab| to a
suggested spot just above your Notes (Memo-type) field control. Highlight
your unbound control and open the property sheet (Go to Menu Bar, click View,
click Properties). Name the unbound control, “CommentUnbound†(or any other
name you wish) and keep the record control line blank (i.e. unbound).

Click the Event tab in the Property Sheet and place your cursor on the line,
“After Updateâ€. When your cursor is on that line, you will see two control
buttons on the far right side of that line. Click the first button and
highlight the words, “Event Procedure†on the drop-down list. Then click the
second button (ellipsis…) and you will be taken to the Event Procedure
screen. Between the two existing lines, “Private Sub CommentUnbound After
Update () and “End Subâ€, add your event procedure, as shown below:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Private Sub CommentUnbound After Update ()

ADD YOUR EVENT PROCEDURE HERE (See Below)

End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Assuming your unbound comment control is named “CommentUnboundâ€, and your
Memo type field is named “Notesâ€, remembering that the control names might be
different than the actual field names (at your discretion), here is a
suggested event procedure:


-------------- DESCENDING ORDER -------------------

Private Sub CommentUnbound_AfterUpdate()

Me.Notes = vbNewLine & vbNewLine & Format(Now(), “d-mmm-yy hh:nn â€) &
Me.CommentUnbound &†“& Me.Notes

Me.CommentUnbound = Null

DoCmd.GotoControl “CommentUnboundâ€

End Sub
-----------------------------------------------------------------

Note #1: I intentionally formatted Now() to fit European standards:
d-mmm-yy hh:nn to produce 18 Nov 06 1530, as your reply to Fred revealed you
are outside of the U.S.A. Note also in the Event Procedure above that there
are spaces after hh:nn “ which allows space between the date/time stamp and
the actual comment text.

American USA standards would be: m-d-yy h:nn am/pm to produce 11-18-06 3:30 pm

The above date/time formatting, in my opinion, is visually more attractive
and minimizes space when the focus is on the text, not the date/time stamp.

Note #2: If your comment entries are usually one liners, that is very, very
brief. You could use only one NewLine, rather than the suggested two, which
may visually aid a person reviewing all the comment entries. 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â€.



The last line in the Event Procedure is not critical. The “DoCmd.GoToControl
“CommentUnbound†allows the cursor to remain in the unbound control for
another entry. The procedure above allows for a double line feed so that the
next entry into the Notes field control will appear two lines above the
previous entry for easy reviewing. Your comments therefore appear in
descending order with the latest at the top.

Also, there is a way to capture the name of the person logging in to the
network and if you have a field in your table such as “UpdatedBy†or
“Modifier†,etc., you could add that name to your Date/Time stamp so that you
have a date and time and worker’s name of person adding comments to the Memo.
Explaining how to perform this task, however, requires a longer discussion
that doesn’t address your immediate needs.

SHOULD I LOCK THE NOTES FIELD CONTROL?
Locking the Notes field control and keying in text to an unbound control is
not always desirable, as staff can more easily type and review the comments
if they type directly into the Notes control (field). There are also many
times that the user will need to edit the text he/she enters, particularly if
the text is long. Your method doesn’t allow corrections or edits if the memo
field is locked. A worker may review the text entered into the Memo and
decide minutes later that the information needs to be modified. The only
recourse is to make another entry explaining a correction or addition to a
previous entry. It could be tiring to whoever has to read all the
notes/comments in the Memo field. Most workers will, however, find the
unbound control to enter comments a helpful tool, while the Notes memo field
control remains unlocked, open for editing.

If you are working with a trustworthy team and you yourself set a trusting
work environment, there should be no reason to lock your workers out of the
Notes field. An example might be social worker staff assigned to cases or
clients having full responsibility to document all communications between
social worker and client. That is, basically all data entries are made by
the same person assigned to that specific record. Professionals in this kind
of trusting environment are more focused on health and welfare of clients
than on modifying the record’s data for some self-serving reasons. A daily
backup system on a shared drive, provides another level of data integrity
that helps a supervisor feel at ease in maintaining a trusting work
environment.

Hope this helps.

If our answers (Fred’s and mine) were helpful to you, please click “Yes†on
the appropriate buttons so other readers can refer to this problem/answer set
as being helpful.
 
A

arogers via AccessMonster.com

Tank, followed your instructions and all I got was a sintax error with the
Private sub highlited and the first two lines of the code in red!

Allan
Hi Allan,

Fred’s comments below are perfectly good and succinct. Here are my comments
that may help support Fred’s approach to the problem and hopefully provide
additional detailed clarification. Please forgive me if I go into some
elementary details for the sake of readers less experienced.

In Form design view, from the Toolbox bar, drag the text box icon ab| to a
suggested spot just above your Notes (Memo-type) field control. Highlight
your unbound control and open the property sheet (Go to Menu Bar, click View,
click Properties). Name the unbound control, “CommentUnbound†(or any other
name you wish) and keep the record control line blank (i.e. unbound).

Click the Event tab in the Property Sheet and place your cursor on the line,
“After Updateâ€. When your cursor is on that line, you will see two control
buttons on the far right side of that line. Click the first button and
highlight the words, “Event Procedure†on the drop-down list. Then click the
second button (ellipsis…) and you will be taken to the Event Procedure
screen. Between the two existing lines, “Private Sub CommentUnbound After
Update () and “End Subâ€, add your event procedure, as shown below:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Private Sub CommentUnbound After Update ()

ADD YOUR EVENT PROCEDURE HERE (See Below)

End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Assuming your unbound comment control is named “CommentUnboundâ€, and your
Memo type field is named “Notesâ€, remembering that the control names might be
different than the actual field names (at your discretion), here is a
suggested event procedure:

-------------- DESCENDING ORDER -------------------

Private Sub CommentUnbound_AfterUpdate()

Me.Notes = vbNewLine & vbNewLine & Format(Now(), “d-mmm-yy hh:nn â€) &
Me.CommentUnbound &†“& Me.Notes

Me.CommentUnbound = Null

DoCmd.GotoControl “CommentUnboundâ€

End Sub
-----------------------------------------------------------------

Note #1: I intentionally formatted Now() to fit European standards:
d-mmm-yy hh:nn to produce 18 Nov 06 1530, as your reply to Fred revealed you
are outside of the U.S.A. Note also in the Event Procedure above that there
are spaces after hh:nn “ which allows space between the date/time stamp and
the actual comment text.

American USA standards would be: m-d-yy h:nn am/pm to produce 11-18-06 3:30 pm

The above date/time formatting, in my opinion, is visually more attractive
and minimizes space when the focus is on the text, not the date/time stamp.

Note #2: If your comment entries are usually one liners, that is very, very
brief. You could use only one NewLine, rather than the suggested two, which
may visually aid a person reviewing all the comment entries. 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â€.

The last line in the Event Procedure is not critical. The “DoCmd.GoToControl
“CommentUnbound†allows the cursor to remain in the unbound control for
another entry. The procedure above allows for a double line feed so that the
next entry into the Notes field control will appear two lines above the
previous entry for easy reviewing. Your comments therefore appear in
descending order with the latest at the top.

Also, there is a way to capture the name of the person logging in to the
network and if you have a field in your table such as “UpdatedBy†or
“Modifier†,etc., you could add that name to your Date/Time stamp so that you
have a date and time and worker’s name of person adding comments to the Memo.
Explaining how to perform this task, however, requires a longer discussion
that doesn’t address your immediate needs.

SHOULD I LOCK THE NOTES FIELD CONTROL?
Locking the Notes field control and keying in text to an unbound control is
not always desirable, as staff can more easily type and review the comments
if they type directly into the Notes control (field). There are also many
times that the user will need to edit the text he/she enters, particularly if
the text is long. Your method doesn’t allow corrections or edits if the memo
field is locked. A worker may review the text entered into the Memo and
decide minutes later that the information needs to be modified. The only
recourse is to make another entry explaining a correction or addition to a
previous entry. It could be tiring to whoever has to read all the
notes/comments in the Memo field. Most workers will, however, find the
unbound control to enter comments a helpful tool, while the Notes memo field
control remains unlocked, open for editing.

If you are working with a trustworthy team and you yourself set a trusting
work environment, there should be no reason to lock your workers out of the
Notes field. An example might be social worker staff assigned to cases or
clients having full responsibility to document all communications between
social worker and client. That is, basically all data entries are made by
the same person assigned to that specific record. Professionals in this kind
of trusting environment are more focused on health and welfare of clients
than on modifying the record’s data for some self-serving reasons. A daily
backup system on a shared drive, provides another level of data integrity
that helps a supervisor feel at ease in maintaining a trusting work
environment.

Hope this helps.

If our answers (Fred’s and mine) were helpful to you, please click “Yes†on
the appropriate buttons so other readers can refer to this problem/answer set
as being helpful.
-------
Tank
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
[quoted text clipped - 3 lines]
 
G

Guest

Hi Allan,

I'm sorry for the confusion. The first two lines are really supposed to be
on the same line. When I added the code in my reply to you, the posting
pushed a portion of the line onto a second line.

Would you mind moving the second line to the end of the first line? I think
that will correct your problem.

If I had realized the posting might split the code, I would have introduced
the underscore to make the split. Properly splitting the line helps the
reader see the entire code without having to scroll left and right to view
the entire line.

The underscore is sometimes referred to as a "Visual Basic line-continuation
character". As you probably know, anytime you want to continue a line of
code on a second line, you can type a space followed by this character (the
underscore), and then continue on a new line. Visual Basic interprets the
code as if it were all on one line.

Here's perhaps how I should have displayed the event procedure in your
example (Note the space after & followed by the underscore):

Private Sub CommentUnbound_AfterUpdate()

Me.Notes = vbNewLine & vbNewLine & Format(Now(), “d-mmm-yy hh:nn â€) & _
Me.CommentUnbound &†“& Me.Notes

Me.CommentUnbound = Null

DoCmd.GotoControl “CommentUnboundâ€

End Sub


So, you have two alternatives: (1) Put both lines on one line; or (2) Use
the Space/Underscore to break the code onto two lines.

Please let me know if this helps solve your problem.
 
A

arogers via AccessMonster.com

Hi Tank

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

It stamps the notes with date and time but they are always at the latest note
is always at the bottom and not at the top.

Regards

Allan
 
A

arogers via AccessMonster.com

Hi Tank

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

It stamps the notes with date and time but they are always at the latest note
is always at the bottom and not at the top.

Regards

Allan
 
A

arogers via AccessMonster.com

Private Sub Notes_AfterUpdate()
Me.Notes = Me.Notes & " " & Now() & " "

End Sub

The above works just fine, except it doesn't put the last notes at the top of
the field, which is were I want it.

Thanks

Allan
What about

Me.Notes = Now() & " " & Me.Notes
[quoted text clipped - 68 lines]
 
D

Douglas J. Steele

Various people in this thread have asked you to explain exactly what it is
you want, and you haven't bothered to answer any of them.

If you can't provide basic information about what it is you're trying to do,
it's extremely difficult for any of us to help!

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


arogers via AccessMonster.com said:
Private Sub Notes_AfterUpdate()
Me.Notes = Me.Notes & " " & Now() & " "

End Sub

The above works just fine, except it doesn't put the last notes at the top
of
the field, which is were I want it.

Thanks

Allan
What about

Me.Notes = Now() & " " & Me.Notes
[quoted text clipped - 68 lines]
 
A

arogers via AccessMonster.com

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.

Allan
Various people in this thread have asked you to explain exactly what it is
you want, and you haven't bothered to answer any of them.

If you can't provide basic information about what it is you're trying to do,
it's extremely difficult for any of us to help!
Private Sub Notes_AfterUpdate()
Me.Notes = Me.Notes & " " & Now() & " "
[quoted text clipped - 18 lines]
 
D

Douglas J. Steele

Me.Notes = Now() & " " & Me.Notes

will put the current date/time stamp at the beginning of your notes field.

However, from what you're saying, that's not what you want.

I think Tank probably came closest to what you want with the suggestion of
having two text box: one unbound, and one bound to your Notes field.
Whenever you type something into the unbound text box and then move to
another text box, the code Tank gave you will put the current date/time and
whatever you typed into the unbound text box at the top of the bound text
box. There are some potential errors in that code, but since you didn't
indicate what line generates the syntax error, we can only guess. I wouldn't
bother with the DoCmd.GoToControl instruction, and I'd use vbCrLf rather
than vbNewLine. I'd also put a new line between the comment you just added
and the rest of the text in Notes.

Private Sub CommentUnbound_AfterUpdate()

Me.Notes = Format(Now(), "d-mmm-yy hh:nn ") & _
Me.CommentUnbound &vbCrLf & Me.Notes

Me.CommentUnbound = vbNullString

End Sub


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


arogers via AccessMonster.com said:
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.

Allan
Various people in this thread have asked you to explain exactly what it is
you want, and you haven't bothered to answer any of them.

If you can't provide basic information about what it is you're trying to
do,
it's extremely difficult for any of us to help!
Private Sub Notes_AfterUpdate()
Me.Notes = Me.Notes & " " & Now() & " "
[quoted text clipped - 18 lines]
 
J

John Vinson

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]
 
A

arogers via AccessMonster.com

Thanks John,

I'll make do with

Private Sub Notes_AfterUpdate()
Me.Notes = Me.Notes & " " & Now() & " "

End Sub

I will only be adding notes to my notes field 3 or 4 times max in my two sub
forms so scrolling wont be a problem. I already have calls log table which
will be be my main notes records also as a sub form.

Many thanks

Allan

John said:
I'm sorry Douglas I have explained exactly what I would like to do right from
the very start and I will repeat :
[quoted text clipped - 6 lines]
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]
 
G

Guest

Hi Allan. Well, we’re really raking this one over. Hope you’ll hang in.
Doug’s comments are great and right on target.

I’m a bit concerned with your original feedback to me that you get a syntax
error with the coding I suggested. I’m still puzzled how you would get that
error message, but that’s hopefully not going to happen any more. I think
possibly you might have tried to enter the event procedure into the Notes
field rather than into the unbound control that Fred and I suggested earlier.
Although my original coding works fine in my applications, I will present a
slight modification below using some of Doug’s suggestions, simply to be
consistent with input.

I feel the application using an unbound control to enter the data for the
memo field is the best way to go vs. expecting users to enter directly into
the memo field control and expect the date and time to display right away for
them. The date and time will display, but only after tabbing out of the
field control (AfterUpdate).

So, here is the modification I am suggesting in using the unbound control in
conjunction with the Notes memo field.

FOLLOWING IS FOR AN UNBOUND CONTROL THAT TRANSFERS DATA ENTRY TO A MEMO
FIELD IN DESCENDING ORDER (most recent at top) ADDING A DATE/TIME STAMP:

Me.Notes = vbCrLf & vbCrLf & Now() & vbCrLf _
& Me.CommentUnbound & " " & Me.Notes

Me.CommentUnbound = vbNullString


THIS PRODUCES THE FOLLOWING FORMATTING USING SAMPLE DATA:

11-26-07 4:23 pm.
Friday is coming after Thursday.

11-26-07 4:22 pm.
Thursday will come next. This memo system uses an unbound control
to enter data. When the cursor leaves the unbound control, the information
is transferred to the Memo.

11-26-07 4:20 pm.
Wednesday will come first.

Doug Steele’s example produces the following sample:

26-Nov-06 18:03 The most recent entry displays on top (descending order).
26-Nov-06 18:02 Let's go one more time to show the descending order.
26-Nov-06 18:01 Now we will try this again
26-Nov-06 18:00 I will test Doug Steele's version.

Doug did suggest, “I'd also put a new line between the comment you just added
and the rest of the text in Notesâ€. My coding above addresses Doug’s advice
by starting off with two line feeds.

Please also keep in mind that your need to use the same control names in
your coding as the names you give the controls. For example, if you place an
unbound control on your form in design view, you will have to name it and use
that name in your event procedure. I sometimes make that mistake and lose
time figuring out why the procedure is not working correctly.
“CommentUnboundâ€, for example is just a name I suggested. You may have been
working with another name for that control, such as “Text1027†or something
like that.

Sorry for any confusion, and please let us know if this is working for you,
and if not, please provide as much information as you can, even if it means
listing your steps in building this event procedure. That way, we might
discover something that will save us all a lot of time.

- - - -
Tank
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top