Results 1 to 5 of 5

Thread: Memo Field

  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Memo Field

    I'm using Access 97. I need a button for a form that, when clicked, will go to the end of a memo field and execute the equivalent of two carriage returns (like leaving a blank line between the old data and the new) and stop there waiting for further data entry. Any ideas are appreciated. Thanks in advance!

  2. #2
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Memo Field

    Try this in the click event of the button:

    Me.txtDescription.SetFocus
    SendKeys "{F2}"
    SendKeys "^{ENTER}"
    SendKeys "^{ENTER}"

    where txtDescription is the name of the control bound to the memo field.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Memo Field

    Here's a sample Access 97 database that contains a form used to edit a memo field. It allows the user to simply hit enter to break the paragraph and does a few other interesting things as well, including allowing tabs in the field. I haven't played with this for a while, so don't expect too much of it. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Attached Files Attached Files
    Charlotte

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Memo Field

    Thank you very much!

  5. #5
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sample Memo Field Question

    Charlotte: Thank you ... your sample was exactly what I needed to satisfy a customer request to press Enter in a memo field (my memo field is named Notepad). I added the following code to the OnEnter event of the memo field so that a return/CurrentDate/:/space would be placed on a new line each time the user entered the field to add a subsequent note. The cursor then goes to the end of the current line, so the user can begin typing.

    Private Sub Notepad_Enter()

    Dim vDate As Date
    Dim vColon As String

    vDate = Format(Date, "Short Date")
    vColon = ": "

    Me![Notepad] = Me![Notepad] & vbCrLf & vDate & vColon
    Me![Notepad].SelStart = Len(Me![Notepad]) + 1

    End Sub

    So far, so good. The problem is that placing the cursor at the end automatically scrolls the text box down, so that only the current date line is visible, even if there is plenty of space in the text box to see the entire contents of the memo field. The user has to scroll up to see prior notes. Is there a way to stop that from happening, that is; place the cursor at the current line without scrolling down unless it is necessary?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •