gvd
gvd

Reputation: 1592

Manage quotes inside string VBA

I trying to insert to Access Table some values that I getting from another table, the problem is that some values comes with quotes and double quotes inside the string, like this example:

str1 = "Non-fusible sectionalizing "green' low rise switch."

How can I manage quotes inside string in VBA for Access 2010 for can insert it into table?

Upvotes: 1

Views: 14608

Answers (1)

Tanner
Tanner

Reputation: 22733

From memory I think you just need to double them up to look like this:

str1 = "Non-fusible sectionalizing ""green' low rise switch."

You can perform a Replace on the string using Chr(34) - the " character:

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

Upvotes: 4

Related Questions