Results 1 to 7 of 7
  1. #1
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107

    Append additional information to a field

    I have a summary field that contains data. Sometimes I have additional information that needs to be attached with the current data. For instance:



    Old Data: Product A is very nice. It has a red exterior and a blue interior. People of all ages should enjoy this product. It is estimated that consumers will pay $500-$600 for this product.

    New Data: 01/01: Children 0-12 years of age find this product to be especially amusing. New marketing should be pushed towards this age group.

    I want this to all be combined, like the following:

    Product A is very nice. It has a red exterior and a blue interior. People of all ages should enjoy this product. It is estimated that consumers will pay $500-$600 for this product.

    01/01: Children 0-12 years of age find this product to be especially amusing. New marketing should be pushed towards this age group.


    Is this possible to do in an append query? to keep the old data and just append this current data along with it?

    Thank you!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You would want an update query, not an append query. An append query adds a new record, an update query modifies an existing record. It can do what you're asking.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107
    Thank you for getting back to me PBaldy, I appreciate it.

    I am not certain I understand how to use an update statement in a way that will keep the old data and only add new data. It was my understanding that when you use an update statement, the previous data is removed and the new data is placed. If my new data contained none of the old data, how could I go about adding this new data while still keeping the old?


    Thank you!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Any number of ways, but since you asked about queries, an update query would look like:

    UPDATE TableName
    SET FieldName = FieldName & " More info here"

    The key in any method is to concatenate the existing value with the new.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107
    Thank you! I can't believe that never occurred to me; that's basic programming...

    One more question, if you don't mind: is it possible to compare the data to see if any new data has been added? Like if you had abcdefghij in the original data, and your new data contained the exact same thing, but there are other records that need updating? I don't want to have abcdefghjijabcdefghij.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Perhaps, though it might help to know your specifics. Generally I'd expect to be updating a specific record, so in a query I'd be adding a criteria:

    UPDATE TableName
    SET FieldName = FieldName & " More info here"
    WHERE KeyFieldName = 123
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107
    I have a large report that is given to me in an excel file. I have imported this file into access and created the appropriate field names. This report is sent out every week, and there are small changes that are made throughout the report. I have a macro that looks over the report and makes updates throughout. This works for all the fields except for the description fields, which need to keep there old data and attach the new data, which may not match the old data. This will only happen for a few products out of the thousand that are in the report, so I have no way to set the specific criteria.

    Any expert thoughts on this?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Default Information for an existing field HELP
    By opinionsrfun in forum Access
    Replies: 1
    Last Post: 06-19-2013, 06:30 AM
  2. Replies: 1
    Last Post: 06-02-2011, 04:11 AM
  3. additional detail records to be inserted
    By Mclaren in forum Reports
    Replies: 1
    Last Post: 03-16-2011, 02:10 AM
  4. Adding an additional WHERE clause
    By Pells in forum Queries
    Replies: 7
    Last Post: 10-28-2010, 12:44 PM
  5. Additional params for ANY query
    By dnagir in forum Access
    Replies: 0
    Last Post: 01-21-2009, 10:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums