Results 1 to 3 of 3

Thread: Find and replace in Access (2002) multiple parts of strings

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    78

    Find and replace in Access (2002) multiple parts of strings

    Good morning,

    What is the best approach for finding and replacing parts of strings in an Access database? For instance:

    The database field could contain the following string:
    Q4 = "Married" OR Q4 = "Separated" AND Q76 = "No" OR Q76 = "Does not apply"

    I need to be able to replace both instances of "Q76" with say "Q77"

    How complicated is this? I'm not even sure where to begin!

    I am using VB 6.0, Access 2002, and connect as an ADO recordset.

    Thanks for any suggestions!
    Mary

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Open the table in access
    Select the column
    Ctrl + H or Menu>Edit>Replace
    What >>>> Q76
    Replace with >>> Q77
    Match >>>> Any part of field

    Then if you are really sure its okk and you won't be changing critical parts incorrectly -> Replace all

    Oh --- it'll ask you to save when you close the table - say yes to save all the amendments...


    Vince
    Last edited by Ecniv; Apr 14th, 2004 at 09:24 AM.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    78
    Thanks Vince... now let me clarify (my bad!)...

    I need to write code that does this through my VB 6.0 frontend!!

    I have not attempted yet to automate Access, maybe I'll play with it this afternoon, but thought it might be better to use SQL code or something since eventually this will have to work with Access 2003 and Oracle in the long-run (I'd rather it work no matter what it's connected to!).

Posting Permissions

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



Click Here to Expand Forum to Full Width