need date/time stamp on each line in memo field

F

Fatboymedic

I have a memo field, which needs to have a date/time stamp appended to the
end of each line, when the enter key is pressed

ie: test line 1 <enter> 01:01:01 09/05/05
test line 2 <enter> 01:01:50 09/05/05

Help Please !
 
A

Allen Browne

It would be possible to use the KeyDown or Change events of the control to
trap the Enter key, and replace it with the previous characters & Now() &
the subsequent characters, using SelStart, SelLength, Len() and so on.

However, if each line is intended to be dated, a better solution would be to
create a related table of notations instead of trying to force all of this
data into a single memo field, and still not be able to search on the dates,
or manipulate their order, etc.

Create a related table with a date field and a memo field. Set the Default
Value of the date/time field to:
=Now()
and it will automatically populate whenever someone adds a new comment row
to the related table.
 
F

Fatboymedic

I think i get it...
the memo field is set up on the form to be a scrolling record of notes added
(its a simple dispatching database), and displays on the form itself, and on
a report. If I set up a related table, I assume I would need a control (ie
button) and an unbound display field, with the info concatenated? I will not
need to search for the updated notes, thats why i just wanted to have it
stamp the memo field entries

Thank You!!
 
A

Allen Browne

Yes, typically the interface would be a main form for whatever you are
making notes on, with a subform to show the many notes (one per line.)
 
F

Fatboymedic

thank you so much, Allen

one last bit.. can i display all the values, date/time + note, for each
record, in a text box? I have successfully created the new table, with an ID,
date, and note field,linked by ID, so each entry is associated with the main
record, and i made a text box, with the "=[subfrm date/time notes].Form!date
& " " & [subfrm date/time notes].Form!note" control.. but it only gives the
data from the selected entry on the subform... i want to see ALL entries for
the record - i will need this for the report i create as well....
 
A

Allen Browne

Open the subform in design view.
Open the Properties box (View menu).
While looking at the properties of the Form (not a text box), on the Format
tab, set the Default View to one of these:
Continuous Form
Datasheet.
It will then show one record per row.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Fatboymedic said:
thank you so much, Allen

one last bit.. can i display all the values, date/time + note, for each
record, in a text box? I have successfully created the new table, with an
ID,
date, and note field,linked by ID, so each entry is associated with the
main
record, and i made a text box, with the "=[subfrm date/time
notes].Form!date
& " " & [subfrm date/time notes].Form!note" control.. but it only gives
the
data from the selected entry on the subform... i want to see ALL entries
for
the record - i will need this for the report i create as well....

Allen Browne said:
Yes, typically the interface would be a main form for whatever you are
making notes on, with a subform to show the many notes (one per line.)
 
M

Maly

Allen, I have followed these instructions as I had the same issue. It was all
a great help, but now I need just a little more guidance. What can I do to
make sure that the record (it its entirety) is locked once data is entered?
i.e. after I enter the memo and tab to the next record, I want the previous
record locked (even if only on the form, but preferably on the query and/or
table as well)


Allen Browne said:
Open the subform in design view.
Open the Properties box (View menu).
While looking at the properties of the Form (not a text box), on the Format
tab, set the Default View to one of these:
Continuous Form
Datasheet.
It will then show one record per row.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Fatboymedic said:
thank you so much, Allen

one last bit.. can i display all the values, date/time + note, for each
record, in a text box? I have successfully created the new table, with an
ID,
date, and note field,linked by ID, so each entry is associated with the
main
record, and i made a text box, with the "=[subfrm date/time
notes].Form!date
& " " & [subfrm date/time notes].Form!note" control.. but it only gives
the
data from the selected entry on the subform... i want to see ALL entries
for
the record - i will need this for the report i create as well....

Allen Browne said:
Yes, typically the interface would be a main form for whatever you are
making notes on, with a subform to show the many notes (one per line.)

I think i get it...
the memo field is set up on the form to be a scrolling record of notes
added
(its a simple dispatching database), and displays on the form itself,
and
on
a report. If I set up a related table, I assume I would need a control
(ie
button) and an unbound display field, with the info concatenated? I
will
not
need to search for the updated notes, thats why i just wanted to have
it
stamp the memo field entries

Thank You!!

:

It would be possible to use the KeyDown or Change events of the
control
to
trap the Enter key, and replace it with the previous characters &
Now() &
the subsequent characters, using SelStart, SelLength, Len() and so on.

However, if each line is intended to be dated, a better solution would
be
to
create a related table of notations instead of trying to force all of
this
data into a single memo field, and still not be able to search on the
dates,
or manipulate their order, etc.

Create a related table with a date field and a memo field. Set the
Default
Value of the date/time field to:
=Now()
and it will automatically populate whenever someone adds a new comment
row
to the related table.

I have a memo field, which needs to have a date/time stamp appended
to
the
end of each line, when the enter key is pressed

ie: test line 1 <enter> 01:01:01 09/05/05
test line 2 <enter> 01:01:50 09/05/05
 
S

strive4peace

Hi Maly,

put this on the form OnCurrent event for the form with your
memo field:

'~~~~~~~~~~~~~~~~~~~
me.AllowEdits = _
IIF(isnull(me.memo_controlname), true,false)
'~~~~~~~~~~~~~~~~~~~

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
Allen, I have followed these instructions as I had the same issue. It was all
a great help, but now I need just a little more guidance. What can I do to
make sure that the record (it its entirety) is locked once data is entered?
i.e. after I enter the memo and tab to the next record, I want the previous
record locked (even if only on the form, but preferably on the query and/or
table as well)


:

Open the subform in design view.
Open the Properties box (View menu).
While looking at the properties of the Form (not a text box), on the Format
tab, set the Default View to one of these:
Continuous Form
Datasheet.
It will then show one record per row.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

thank you so much, Allen

one last bit.. can i display all the values, date/time + note, for each
record, in a text box? I have successfully created the new table, with an
ID,
date, and note field,linked by ID, so each entry is associated with the
main
record, and i made a text box, with the "=[subfrm date/time
notes].Form!date
& " " & [subfrm date/time notes].Form!note" control.. but it only gives
the
data from the selected entry on the subform... i want to see ALL entries
for
the record - i will need this for the report i create as well....

:


Yes, typically the interface would be a main form for whatever you are
making notes on, with a subform to show the many notes (one per line.)


I think i get it...
the memo field is set up on the form to be a scrolling record of notes
added
(its a simple dispatching database), and displays on the form itself,
and
on
a report. If I set up a related table, I assume I would need a control
(ie
button) and an unbound display field, with the info concatenated? I
will
not
need to search for the updated notes, thats why i just wanted to have
it
stamp the memo field entries

Thank You!!

:


It would be possible to use the KeyDown or Change events of the
control
to
trap the Enter key, and replace it with the previous characters &
Now() &
the subsequent characters, using SelStart, SelLength, Len() and so on.

However, if each line is intended to be dated, a better solution would
be
to
create a related table of notations instead of trying to force all of
this
data into a single memo field, and still not be able to search on the
dates,
or manipulate their order, etc.

Create a related table with a date field and a memo field. Set the
Default
Value of the date/time field to:
=Now()
and it will automatically populate whenever someone adds a new comment
row
to the related table.


I have a memo field, which needs to have a date/time stamp appended
to
the
end of each line, when the enter key is pressed

ie: test line 1 <enter> 01:01:01 09/05/05
test line 2 <enter> 01:01:50 09/05/05
 

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