date stamp a memo/text box automtatically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ned1966
    New Member
    • Sep 2007
    • 4

    date stamp a memo/text box automtatically

    I want to automatically date stamp a memo/text box when i click a combo box. i know how to start the code bulider in the event properties of the combo box and get it to select the memo/text box i.e combo123.SetFoc us and combo123.Value = today () but what i would like it to do is to go to the end of whatever text is already in the memo/text box, select a new line, date stamp it and select another line ready to add more notes
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Originally posted by Ned1966
    I want to automatically date stamp a memo/text box when i click a combo box. i know how to start the code bulider in the event properties of the combo box and get it to select the memo/text box i.e combo123.SetFoc us and combo123.Value = today () but what i would like it to do is to go to the end of whatever text is already in the memo/text box, select a new line, date stamp it and select another line ready to add more notes
    If your memo field is called Memofield then this code in the On Enter event of your textbox should do what you want. Obviously change the name below to the actual name of your field...

    Private Sub MemoField_Enter ()
    Me.MemoField = Me.MemoField & " " & Now()
    End Sub

    Comment

    • puppydogbuddy
      Recognized Expert Top Contributor
      • May 2007
      • 1923

      #3
      If you want to update the memobox every time you make a selection from a combo box, use the following code:

      Private Sub YourCombo_After Update()
      Me.MemoField = Me.MemoField & " " & Now()
      End Sub

      Comment

      • Ned1966
        New Member
        • Sep 2007
        • 4

        #4
        Originally posted by puppydogbuddy
        If you want to update the memobox every time you make a selection from a combo box, use the following code:

        Private Sub YourCombo_After Update()
        Me.MemoField = Me.MemoField & " " & Now()
        End Sub

        Thanks... just one more thing. The command above leaves the text in the cell highlighted. How do i get it to send the cursor to the end of the text then carriage return to start a new line?

        Comment

        • puppydogbuddy
          Recognized Expert Top Contributor
          • May 2007
          • 1923

          #5
          Originally posted by Ned1966
          Thanks... just one more thing. The command above leaves the text in the cell highlighted. How do i get it to send the cursor to the end of the text then carriage return to start a new line?
          Try this:

          Private Sub YourCombo_After Update()
          Me.MemoField = Me.MemoField & " " & Now() & vbCr & vbLf
          End Sub

          Comment

          • Ned1966
            New Member
            • Sep 2007
            • 4

            #6
            Originally posted by puppydogbuddy
            Try this:

            Private Sub YourCombo_After Update()
            Me.MemoField = Me.MemoField & " " & Now() & vbCr & vbLf
            End Sub

            thanks again one last thing how do i get the cursor to flash at the end of the text ready to type rather than select and highlight the whole of the text box.

            Comment

            • puppydogbuddy
              Recognized Expert Top Contributor
              • May 2007
              • 1923

              #7
              Originally posted by Ned1966
              thanks again one last thing how do i get the cursor to flash at the end of the text ready to type rather than select and highlight the whole of the text box.

              Try this:

              Private Sub YourCombo_After Update()
              Me.MemoField = Me.MemoField & " " & Now() & vbCr & vbLf
              Me!MemoField.Se lStart = Me!MemoField.Se lLength
              End Sub

              Comment

              Working...