I have a form with a datagrid and a button on it. I can get the data to fill the datagrid with the sql statement
Dim adapter As New OleDb.OleDbDataAdapter("Select * from table1",cn)
Ok, I add a text box to the form, and call it txtEntryBox. I want to type a name in the txtEntryBox, and get the SQL statement above to search for it. I have come up with:
Dim adapter As New OleDb.OleDbDataAdapter("Select * from table1 where name= ' & strtext & '", cn)
where strtext is a string variable I have declared, and moved the content of the txtEntryBox into it. The variable is moving into strtext as running a msgbox at the end containing the strtext is ok.
However, the sql statement always returns a blank. Its as if it cannot include the content of the txtEntryBox (strtext) in the sql statement, or I am writing it wrong.
Or am I doing it all wrong??? Its been driving me nuts!!!
Dim adapter As New OleDb.OleDbDataAdapter("Select * from table1",cn)
Ok, I add a text box to the form, and call it txtEntryBox. I want to type a name in the txtEntryBox, and get the SQL statement above to search for it. I have come up with:
Dim adapter As New OleDb.OleDbDataAdapter("Select * from table1 where name= ' & strtext & '", cn)
where strtext is a string variable I have declared, and moved the content of the txtEntryBox into it. The variable is moving into strtext as running a msgbox at the end containing the strtext is ok.
However, the sql statement always returns a blank. Its as if it cannot include the content of the txtEntryBox (strtext) in the sql statement, or I am writing it wrong.
Or am I doing it all wrong??? Its been driving me nuts!!!