Double quote " in string variable?

geralf

Registered User.
Local time
Today, 16:14
Joined
Nov 15, 2002
Messages
212
Hi,
I can't get my head around this today, so any assistance is most welcome.

How do I use a double quote sign in a VBA variable, so when the variable is passed to a textbox, it shows up as one?

eg:

strA= ?
Me.MyControl=strA

MyControl show "

Regards
Gerhard
 
Code:
    Dim strA As String
    
    strA = """This is how you do it,"" said Mile-O-Phile."
    
    MsgBox strA
 
For each set of quotations marks you want within your string - replace it with two.
 
Thanks for the reply Mile-O-Phile.

It works as you say, but only if I put some text/charachter between the quotes. I'm trying to use a single double qoute sign (to use as a repeat symbol for the row above in a report) so I came to think of the ascii table and used strA=Chr(34) to get the " displayed

I would never have guessed the syntax as you have showen. I'm sure that will be used one day too. Thanks again

Regards
Gerhard
 

Users who are viewing this thread

Back
Top Bottom