Hai everyone, Can anyone help me with the LIKE statements which is the datagrid will show the data when the user input the search text, and the sql will search the record using the LIKE statements, when using the LIKE statements, there might be more than 1 result, for the first time, i want to bind the possible result to the label, where user can click the label then guide the user to the detail info in another page. But i think it might be complicate, and if anyone here now how to do it, i will appreciate it very2 much if they can teach me. Back to the problem, so i want to display the more that 1 result in the datagrid, but i dont know why it cannot display. here the code:
the frame2 is where the datagrid is place. when i run the searching, the datagrid cannot display anything. If u notice, i commented the fillfields where the fillfields is use to check my sql is correct. when i use the fillfields it return a result, but when bind it to the datagrid, it cannot. can anyone help me.
thanks in advance
Code:
Private Sub cmdNameView_Click() Dim strSQL As String inputName = UCase(txtName.Text) 'Set rs = New ADODB.Recordset Set rs = New ADODB.Recordset If inputName <> "" Then strSQL = "SELECT * FROM SUPPLIER WHERE sName LIKE '%" & inputName & "%'" MsgBox strSQL rs.Open strSQL, conn, adOpenKeyset, adLockPessimistic, adCmdText Frame2.Visible = True Set dgSupplyResult.DataSource = rs 'fillfields End If End Sub
thanks in advance
Comment