Replace a Double-Quote

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Will the Replace Function do that?

I tried in a module and it kept "objecting".

TIA - Bob
 
Bob Barnes said:
Will the Replace Function do that?

I tried in a module and it kept "objecting".

Yes, but it's tricky to get it specified right. To get a quote
character inside a quoted literal, you have to double-up the quote. You
can write it like this:

MyField = Replace(MyField, """", """""")

or like this:

MyField = Replace(MyField, Chr(34), Chr(34) & Chr(34))

or like this:

Const Q As String = """"
Const QQ As String = """"""

MyField = Replace(MyField, Q, QQ)

or like this:

Dim Q As String
Dim QQ As String

Q = Chr(34)
QQ = Q & Q

MyField = Replace(MyField, Q, QQ)

Whatever seems clearest to you.
 
Dirk,

Again you help me. THANK you.

I'll now be able to get the Syware Visual CE ASCII files imported into Access.

Thanks again - Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top