Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2011
    Posts
    24

    Unanswered: How Can I Update Field Without Loosing Current Information

    Okay so high level I'm trying to setup an option for a user to be able to move a product from one customer to another. There's a pop up window where they specify what product is being moved and leave a note on the account. I've got the code for the product move, but need help with the note. Issue is there's already a notes area on the account table, that may or may not have information in it.

    What I'm wanting to do is, if a product is moved and and a note is left, I want that note information to be added to whatever information is already in the notes field on the account table.

    i.e. If the notes field already has...

    "This guys is an awesome customer."

    Then a product is moved and a note is left...

    "Customer only wants widgets from now on"


    The new comment field should read:

    "This guys is an awesome customer.
    Customer only wants widgets from now on."


    What's the code I need to just add what's in the note's text box, to the existing notes in the customer account table's field? If it's in depth and you need to see the code I have let me know, but I think it's just a one liner, I'm not sure how to write.

  2. #2
    Join Date
    Apr 2011
    Posts
    34
    Something query of this form might work depending of the sequence of your events.
    Code:
    UPDATE sourceTable T1, DestinationTable T2
    SET T2.Note = T1.note & vbcrlf & T1.note
    vbcrlf or chr(13)...

  3. #3
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    Or you can move the notes information into a new table, keyed on account ID and date that the note was left. Then it becomes a simple matter to add new notes, without worrying about whether there are any there already, and hitting the size limit of the note field.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Posting Permissions

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