• Find/Replace Text? (Access 2000)

    Author
    Topic
    #418993

    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

    Viewing 0 reply threads
    Author
    Replies
    • #944692

      See post 346785. 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”)

      • #944693

        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!
        blush Oops.

        Jeremy

    Viewing 0 reply threads
    Reply To: Find/Replace Text? (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: