Results 1 to 8 of 8
  1. #1
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52

    Update query

    Hello,



    I am trying to create an update query so that I can append a particular set of text.

    I have started using the following:

    Expr1: Left([Material.Ext_Description],InStr(1,[Material.Ext_Description],Chr(10),1)-2) & "" &
    DLookUp("[Text3]", "User_Code", "[Code]='Line 01'")

    However...there are more than one carriage return and my appended test is after the first line rather at the end.

    Thanks in advance for the assist.

    David

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Maybe you need Mid function. Show example of data and the result you want.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    Hello,

    Below is an example of the existing data. I am attempting to add additional text separated by an underline (50 underscores) with additional text after that. I currently have similar queries to perform updates, but seem to be having trouble with this one.

    SS138RD-CL
    Centerless Ground
    Heat Treated (H1100)
    Spec:
    AMS 5629
    AMS-H-6875

    So the text would end up looking like,

    SS138RD-CL
    Centerless Ground
    Heat Treated (H1100)
    Spec:
    AMS 5629
    AMS-H-6875
    __________________________________________________

    'Additional text'

    TIA
    David

  4. #4
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    Hello,

    I actually have a portion of this working.

    Expr1: Mid([Material.Ext_Description],1,Len([Material.Ext_Description])) & Chr(13) & DLookUp("[Text3]","User_Code","[Code]='RS STD Text 04'")

    However, I can not seem to get the carriage return to work.

    Thanks
    David

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Why are you putting all this in one field?

    If you want to append text, why do you need to extract with Mid function? Why not just concatenate?

    Need two codes for CR. It's really CR & LF: Chr(13) & Chr(10)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    Unfortunately it is not our DB. Very limited access, so I have to be creative. I save this Query for future use when we need to update.

    I search for the 50 under scores, keep what's above and replace what is below.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    So did the codes work? I think order matters and 13 is first.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    It did. Thank you.

    David

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

Similar Threads

  1. Replies: 7
    Last Post: 08-26-2013, 06:05 AM
  2. Replies: 1
    Last Post: 05-17-2013, 12:53 PM
  3. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  4. Replies: 4
    Last Post: 11-10-2011, 03:41 PM
  5. Replies: 1
    Last Post: 08-19-2011, 12:16 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