Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find/Replace Text? (Access 2000)

    Ok, so I've searched high and low, found out how to replace text in VBA with a function, but cannot find the expression to use in an update query or code to replace through a macro the value "MW" with "MO". I have a column, called [rstat] which is created through an update query that runs when my database opens. It is created by combining two values, Rank, and Service. I have three basic types of ranks, E*, O* and W*, and service USMC or USN. The query populates the RSTAT column by combining the third letter of service and the first letter of rank. The kink in the works is that when I run crosstab queries, I get MO, MW, ME, NO, NE. MO and MW are both individuals of the same type, and should be counted together. After my update query is ran, I would like to replace MW with MO in the RSTAT column. I hope that is descriptive enough.

    Thanks
    Jeremy
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find/Replace Text? (Access 2000)

    See <post#=346785>post 346785</post#>. You can use the MyReplace function from that post in a query. In an update query, set the Update To: line to

    MyReplace([rstat],"MW","MO")

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find/Replace Text? (Access 2000)

    You know whats funny? I made that post, searched who was online, looked at the post you were looking at, and have already used the info....thank you very much!
    <img src=/S/blush.gif border=0 alt=blush width=15 height=15> Oops.

    Jeremy
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find/Replace Text? (Access 2000)

    That's fine! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

Posting Permissions

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