Putting a Timestamp in a memo field on a form.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a memo filed named Resolution. I would like to have a date and time
appear before resolution information is entered. I would like for each
individual to click a button to put the date and time in the resolution field
before typing what was done..The button should be outside the memo field so
that it is only clicked when new information is being added.
 
In the Click_Event of your CommandButton, use something like:

Me.TextBoxForMemo = (Me.TextBoxForMemo + vbCrLf) & _
Format( Now(), "dd/mm/yyyy hh:nn")
Me.TextBoxForMemo.SelStart = 65535
Me.TextBoxForMemo.SelLength = 0
Me.TextBoxForMemo.SetFocus
 
Thank You. Do I need to add any code to the Resolution memo field to prevent
the users from typing over what is already there when they click the command
button to add date time to enter additional information?
 
No. If you look at the code I posted, I _added_ the date/time to the
existing text in the TextBox Control for the Memo Field and then set the
cursor to the end.
 
Back
Top