Inserting a Date Stamp

jdupaix

Registered User.
Local time
Yesterday, 23:03
Joined
Apr 22, 2008
Messages
13
In a memo field I want to insert a time stamp using a shortcut (ex. Alt D) or whatever. What is the best and easiest way to do that! I will end up with many dates before notes I am taking on different situations. Thanks in advance! Joe
 
I would never recommend making notes this way. I would create a many-side table so that each new note has its own timestamp as well as author stamp.

To do what you want, you can use the BeforeUpdate event of the memo control to concatenate in a leading timestamp ---

Me.SomeDesc = Now() & "----" & Me.SomeDesc

Let us know if you are using A2007 since it has a new data type that you might want to try out.
 
I am using 2003 and I have never used code before in my database. Will you let me know how to do that in beginners terms?
 
Open the properties dialog for the memo control. On the events tab, press the builder button (three dots all the way at the right edge of the field) for the memo control's AfterUpdate property. If a dialog appears, choose the create code option. Copy the one line of code I posted earlier and paste it at the insertion point in the code module. You will need to change "SomeDesc" to the actual name of your memo control. This statement says

set the value of the memo control equal to the date and time followed by some dashes, followed by the text that the user typed in.
 
Thank a lot Pat! I will give it a try! Another question I have for you is this.... On my form, the bottom 1/3 is the box I use to put my notes in. When I start typing in the box the form shifts up 3-4 inches to center the form on the monitor. I would rather it not shift and stay where it is. Any advice....

Thanks, Joe
 
If the form is shifting it is because it is not properly sized. Try resizing the bottom box so that it fits correctly on the form. Use the size to fit option on the Window menu to help (the form must be open in form view to use this).
 
I would never recommend making notes this way. I would create a many-side table so that each new note has its own timestamp as well as author stamp.

To do what you want, you can use the BeforeUpdate event of the memo control to concatenate in a leading timestamp ---

Me.SomeDesc = Now() & "----" & Me.SomeDesc

Let us know if you are using A2007 since it has a new data type that you might want to try out.

I would like to know more about that :)
 
I hit the size to fit form but it still shifts when i type in a character, any other ideas?
 
Also Pat regarding the Date Stamp I followed your advice but I am not getting a date to show?

I am looking for this as my outcome

4/22/08 - blahdg;askdfasdjf;alksjdfahg

4/28/08 - aahjfhga;sdf;askdf

etc....
 
If the form is shifting, it is because some element on it is too large.

bodylojohn, look for something called append only. It should be an option for memo fields. The data base format MUST be .accdb since .mdb's do not support any of the new data types.
 

Users who are viewing this thread

Back
Top Bottom