Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I'm doing a macro in order to upload data in the database. using vb script.
As the database as specific type for each field, i need for one field to have double quote (") inside a string.
I mean that my field must be for example: "A"$"2008". That mean that if i put this into a variable, the value of the variable must be :
var = ""A"$"2008""
I'm trying to do so as in vba that mean :
var = """" & "A" & """" & "$" & """" & "2008" & """"
but this doesn't work. I have also tried using chr(34) instead of """" but still the same.
Can anybody help me please ?
Thx a lot
I tried the following and it seems to be ok:
sub toto
dim myvar
myvar = chr(34) & "A" & chr(34) & "$" & chr(34) & "2008" & chr(34)
msgbox myvar
end sub
I know that this is working but only because the msgbox assume alone that if it found 2 " it just keep one.
Look at the value of your variable, you will see that it was :
That mean with to much ".
As i concatewnate this to others values, i really need to have only the good " in my variable.
Please find attached an example. Hope this is what you want.
Thx but it still the same!!
What i want is that the value of the variable (in the macro module -> Variable window (when debug for exemple)) is the following: ""A"$"2008"".
It means a "X" to assume that X is the string and X="A"$"2008".
In fact it was just having a variable (type string) with a " inside the string.
Ok i found another way
Which is ?