date/time stamp

  • Thread starter Thread starter T23459
  • Start date Start date
T

T23459

I am using access 2000.
I'm using field called Comments (memo type field).

I would like to set up this field where the data entry person could type
some comments in this field where a date/time stamp shows up as to when the
person had entered the info.

Comments may be entered in this field at different times/or days and it
would therefore reflect this with a stamp date/time field preceding the
comments.
eg. One could scroll down the field and see the different date/times with
the corresponding comments. Would i use a text box type field instead ?

Any help would be appreciated.
 
T23459 said:
I am using access 2000.
I'm using field called Comments (memo type field).

I would like to set up this field where the data entry person could
type some comments in this field where a date/time stamp shows up as
to when the person had entered the info.

Comments may be entered in this field at different times/or days and
it would therefore reflect this with a stamp date/time field
preceding the comments.
eg. One could scroll down the field and see the different date/times
with the corresponding comments. Would i use a text box type field
instead ?

Any help would be appreciated.

There are a couple of ways to approach this. Technically, this memo
field is really storing information that is in a many-to-one
relationship with the form's main record. At least, I'm assuming you're
doing this on a form -- you can't take either of the approaches I'm
thinking of without using a form.

Anyway, since you're storing many-to-one data, you would make sense to
use a separate table named, say, Comments, with each record having its
own ID field, a foreign key field linking it to the parent record, a
date/time field for when the comment was created, and the comment text
itself. There'd be one record per comment. This table would then be
represented by a subform on the main form, linked via the properties of
the subform control so that all comments added are automatically stamped
with the key field of the record to which they are related, and you only
see the comments related to the current record on the main form. The
date-time stamp could be set automatically in the form's BeforeUpdate or
BeforeInsert event.

The above approach would make it easy to find and query comments by
date, and would keep each comment clearly separate. However, if you
really want all the comments for a particular record to be together in
one big memo field, you could either (a) use code in the memo field's
AfterUpdate event to append the date and time to the contents (after the
new comment, not before it, unless you want to write more elaborate
code), or (b) don't allow entries directly in the memo field, but
instead have an unbound text box into which a new comment may be
entered. The AfterUpdate event of that text box would run code to
append that comment to the memo field, prefixed by the date and time,
possibly on a new line. These two approaches are both easy enough to
achieve, though they take more code than the subform approach, but they
don't allow for easy searching or manipulation of the comments by date.
 
I am using access 2000.
I'm using field called Comments (memo type field).

I would like to set up this field where the data entry person could type
some comments in this field where a date/time stamp shows up as to when the
person had entered the info.

Comments may be entered in this field at different times/or days and it
would therefore reflect this with a stamp date/time field preceding the
comments.
eg. One could scroll down the field and see the different date/times with
the corresponding comments. Would i use a text box type field instead ?

Any help would be appreciated.

I would suggest a separate comments table, related one-to-many to this
table, rather than violating the atomicity principle by putting
multiple comments and multiple dates in a single memo field. If you
have a table with a foreign key to this table, a Comment field, and a
date/time field with Now() as its default, you can put this in a
Subform and enter any number of comments; they'll be all date and time
stamped and individually searchable.

John W. Vinson[MVP]
 
Back
Top