5
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by AndreRet
-1

place wildcard * at the place whre u using the word computer for all computer related book
Adodc2.Recordset.Filter = "[book]='" & b & " * "

Edited by zerocool21: n/a

0

am student please answer me please
this form use combobox change event use this code
serch data show in datagrid

If cmbsd.Text = "1" Then
q = "select *from student where std=" & cmbsd.Text & " AND admin=" & year.Text & " "
r.CursorLocation = adUseClient

r.Open q, cn, adOpenDynamic, adLockPessimistic

set datagrid2.datasource=r
End If

error: data type mismatch criteria expression

0

"error: data type mismatch criteria expression "
this can be due to
u've defined ur constraint in one data type & providing input in another data type

0

Tarang, please open a new thread for your question. This thread belongs to JunJun as above. Further, your select statement is incorrect -

q = "select *from student where std=" & cmbsd.Text & " AND admin=" & year.Text & " "

should read -

q = "SELECT * FROM student WHERE std=" & "'" & cmbsd.Text & "'" & " AND admin=" & "'" & year.Text & "'", cnMyDatabase, adLockOptimistic, adOpenStatic

If you get more errors, please post a new thread with the error and we will gladly help.

0

q = "SELECT * FROM student WHERE std=" & "'" & cmbsd.Text & "'" & " AND admin=" & "'" & year.Text & "'", cnMyDatabase, adLockOptimistic, adOpenStatic
this code reply me AndreRet and i am use this code succesful run

but second time i will run this code error will be introduce
data type mismatch criteria expression

0

Tarang! As above, please open your own thread. This one belongs to JunJun. The reason you are getting the error is because the first time you run the code, your q will open the recordset, but the second time it reaches end of file. Refresh all search criteria and THEN open it again.

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.