Results 1 to 6 of 6
  1. #1
    Keven is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2016
    Posts
    3

    Update query with replace function fails

    I created a memo field in a table and set it to be R T F .
    i imported my data fields with all of the carriage return - line feeds changed to " ! " .
    now I'm using an update query with a replace function to change all of the " ! " instances to c r l f.
    the query uses chr(13)+chr(10) in the replace function.


    when I run the query all of the " ! " are replace but there no visible effect on the text.
    using c t r l - enter manually works to produce a carriage return-line feed, but why doesn't my replace function work??.
    tried to same query in code using vbcrlf instead of the character codes and still couldn't replace correctly.
    what's wrong??
    keven

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,405
    We really need to see your query syntax.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    2007 uses html rather than rtf style (although still called rich text) - so you don't use chr(13)+chr(10)

    Suggest, to confirm the code, you copy it and paste to notepad to see the actual formatting codes

    take a look at this link which asks the same question

    http://www.pcreview.co.uk/threads/ri...eturn.2842502/

  4. #4
    Keven is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2016
    Posts
    3
    Sounds like my problem... Exactly!
    i'll try adding <br> to my replace function parameters!
    i'll let u know if that works... Thanks for the tip
    keven

  5. #5
    Keven is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2016
    Posts
    3
    was:
    UPDATE tableabc SET tableabc.xxx = Replace([tableabc]![xxx]," ! ",Chr(13)+Chr(10));

    this worked in replacing all of my space-bang-space's with carriage returns:
    UPDATE tableabc SET tableabc.xxx = Replace([tableabc]![xxx]," ! ","<br>");

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If this thread is Solved, how about using the thread tools at the top of the thread to mark it Solved?

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

Similar Threads

  1. Replies: 3
    Last Post: 04-02-2014, 10:31 AM
  2. Replies: 2
    Last Post: 06-14-2013, 12:56 PM
  3. Replies: 1
    Last Post: 05-08-2013, 07:08 PM
  4. Update with replace query help
    By goomba79 in forum Queries
    Replies: 4
    Last Post: 12-14-2012, 08:27 AM
  5. Replies: 3
    Last Post: 06-07-2012, 07:05 AM

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