0

hi

i am just starting with vb.net and have set a connection to an existing access db that i have and am able to get the data displayed on a form.

my problem lies where as i want to setup a basic search. i have added a query to a datagrid to dispaly data based on text in a text box.

now my sql query is this:

SELECT CustID, CustName, CustAddress, CustPostcode, CustTel, CustEmail, CustNotes, CustRoom, CustStayArrive, CustStayLeave
FROM tblCustData
WHERE CustName = '"& SearchBox.text &"'


now i get no errors but also no data gets returned. If i add the actual value of one of the records that one gets returned fine but doesnt really help with a search.

wondered if anyone had any ideas?

regards

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by ninjaimp
0

Hello

Try This

SELECT CustID, CustName, CustAddress, CustPostcode, CustTel, CustEmail, CustNotes, CustRoom, CustStayArrive, CustStayLeave
FROM tblCustData
WHERE CustName Like '" & SearchBox.text & "%'

Faisal

hi

i am just starting with vb.net and have set a connection to an existing access db that i have and am able to get the data displayed on a form.

my problem lies where as i want to setup a basic search. i have added a query to a datagrid to dispaly data based on text in a text box.

now my sql query is this:

SELECT CustID, CustName, CustAddress, CustPostcode, CustTel, CustEmail, CustNotes, CustRoom, CustStayArrive, CustStayLeave
FROM tblCustData
WHERE CustName = '"& SearchBox.text &"'


now i get no errors but also no data gets returned. If i add the actual value of one of the records that one gets returned fine but doesnt really help with a search.

wondered if anyone had any ideas?

regards

0

hi

made the change, no error but still not returing anything. Please note that this sql query is being done via the 'Query Configuration Wizard'

im not sure wether i should be doing the query somewhere else, and if so how do i reference the connection?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.