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]