Sep 1, 2006 #1 Spidy6123 Technical User Joined May 30, 2002 Messages 227 Location CA Hey guys, trying to get " character to pass through a string.. does anyone know how to send special characters through string varaibles? TIA
Hey guys, trying to get " character to pass through a string.. does anyone know how to send special characters through string varaibles? TIA
Sep 1, 2006 #2 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR Try this: MsgBox "Double quote = "" ? " Another way is Chr(34) Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
Try this: MsgBox "Double quote = "" ? " Another way is Chr(34) Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Sep 1, 2006 #3 HarleyQuinn Programmer Joined Jan 15, 2003 Messages 4,769 Location GB You can either enclose the double quote in double quotes (e.g. """) or use the Chr() value instead. Code: Private Sub Command2_Click() Text1.Text = Chr(34) & "String" & Chr(34) 'or Text1.Text = """String""" End Sub Both of the above example's will write the text "String" into the textbox. Hope this helps HarleyQuinn --------------------------------- Get the most out of Tek-Tips, read FAQ222-2244 before posting. Upvote 0 Downvote
You can either enclose the double quote in double quotes (e.g. """) or use the Chr() value instead. Code: Private Sub Command2_Click() Text1.Text = Chr(34) & "String" & Chr(34) 'or Text1.Text = """String""" End Sub Both of the above example's will write the text "String" into the textbox. Hope this helps HarleyQuinn --------------------------------- Get the most out of Tek-Tips, read FAQ222-2244 before posting.
Sep 1, 2006 #4 RonRepp Technical User Joined Feb 25, 2005 Messages 1,031 Location US I always liked this method: Code: Dim Q as String Q=Chr(34)'Double Quotes Text1.Text= Q & "String" & Q Everyone has their own way of doing things, and it's what ever works best for you. I hope this helps. Ron Repp If gray hair is a sign of wisdom, then I'm a genius. Upvote 0 Downvote
I always liked this method: Code: Dim Q as String Q=Chr(34)'Double Quotes Text1.Text= Q & "String" & Q Everyone has their own way of doing things, and it's what ever works best for you. I hope this helps. Ron Repp If gray hair is a sign of wisdom, then I'm a genius.