took a quick, very quick look. to add the condition you need to finish the WHERE
cmd = New OleDbCommand("SELECT * from UMP WHERE ", cn)
'to
cmd = New OleDbCommand("SELECT * from UMP WHERE field like " & txtbox.text & "%", cn)
Here's a one more correction. Single quotes are needed around textual parameters
cmd = New OleDbCommand("SELECT * from UMP WHERE field like '" & txtbox.text & "%'", cn)
that is, if the "field"
is textual field. If the "field" is numeric (integer), use
cmd = New OleDbCommand("SELECT * from UMP WHERE field =" & CInt(txtbox.text) , cn)
and trap possible errors.
Reputation Points: 218
Solved Threads: 201
Veteran Poster
Offline 1,024 posts
since Aug 2008