Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Replacing double-quote with empty string (Access 2003)

    Hello,

    I have the following SQL that updates a field containing a single double-quote with an empty string. I can get this to work in a query window, however when I try doing the SQL in VBA, it doesn't work. Does anyone know what I'm doing wrong?

    CurrentDb.Execute "UPDATE TLoc_Agile_MPN SET TLoc_Agile_MPN.MPNStripped = Replace([MPNStripped],"""",'')"

    Thanks in advance for your help.
    Drew

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

    Re: Replacing double-quote with empty string (Access 2003)

    Try
    <code>
    CurrentDb.Execute "UPDATE TLoc_Agile_MPN SET TLoc_Agile_MPN.MPNStripped = Replace([MPNStripped],Chr(34),'')"</code>

  3. #3
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Replacing double-quote with empty string (Access 2003)

    Hans,

    After posting this, I had found that I could use...
    CurrentDb.Execute "UPDATE TLoc_Agile_MPN SET TLoc_Agile_MPN.MPNStripped = Replace([MPNStripped],'""','')"

    However, your approach is much less confusing. Thank you for your help, it's greatly appreciated!

Posting Permissions

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