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

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

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.