Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to append more lines at the end of a memo fiel (97)

    How to append more lines at the end of a memo field?
    I have table field called NOTES which I use to write various notes, sometimes the same note is stretched across several records & I would like to be able to append it to the records using an update query. However, if any of the affected records already contain pre-existing notes then I

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: How to append more lines at the end of a memo fiel (97)

    Did you get an anwer from me already on this? I remember sending it to you, but I don't see it posted. Let me know, and I'll redo it if necessary.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to append more lines at the end of a memo fiel (97)

    no answer.

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: How to append more lines at the end of a memo fiel (97)

    I haven't tested this just now, but I would expect this to work:

    In the update to row put:
    [mymemo] & VBCRLF &
    Regards
    John



  5. #5
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: How to append more lines at the end of a memo fiel (97)

    NOTE: This will work but not in an action query. You can't use named constants like vbCrLf in a query expression. Recommend replace vbCrLf with Chr() function. Example:
    <pre>[fldMemo] & Chr(13) & Chr(10) & "Enter new comment for memo field here."</pre>

    Where [fldMemo] is existing memo field when records updated. Chr(13) = Carriage return, Chr(10) = Linefeed.

    HTH

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: How to append more lines at the end of a memo fiel (97)

    Okay, let's try this again!

    First you need a way to put vbCrLf in a query. Access doesn't recognize that in a query. You could try to remember the character codes, but that takes too much of my precious memory. I create a simple function that I stick in a module. It looks like this:

    Public Function nl( )
    nl = vbCrLf
    End Function

    Now in your query, your "Update to" field will look like this:

    MemoField + nl( ) & "The stuff you wanted to add."

    Using the "+" solves the problem of starting the field with a blank line if the memo field is null. Anything added to null produces a null.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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