"Quotations" in variables - Need Master-Gurus of VB help plese
Here is the problem...
I need to save quotes in a variable. How in the world do you do that? I have declared the following variables as strings SearchField and SearchString. I need to have these variables in quotes per the appropriate syntax, unless there is a better way to do this.
Code:
Dim SearchField As String
Dim SearchString As String
Private Sub cmdFindNext_Click()
frmMain.Data1.Recordset.FindNext SearchField Like SearchString
MsgBox frmMain.Data1.Recordset.Fields(searchfield)
End Sub
Without the variables, the code might look like this:
(ie-with the quotes)
Code:
Private Sub cmdFindNext_Click()
frmMain.Data1.Recordset.FindNext "answer Like '*20*'"
MsgBox frmMain.Data1.Recordset.Fields("answer")
End Sub
Again, the question is how do you place data in a variable, which would ordinarily require quotes. If this is confusing, let me go at it another way. How would you have a textbox display a variable with quotes? For example you want the textbox to say quote Hello World unquote or another example/question is: This is my "butcher" knife
How would you have the word butcher show in quotes, especially if that whole sentence is the result of a variable(string)?????
Thanks,
Sal