Hi all expert!
I'm using adodb for my sql database, I have a text box where try to code it as search fields, when the user key-in the textbox it will auto display the listbox which attache as follow and it will search by every single character.
the example code are:
Private Sub txtFCode_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 97 To 122: KeyAscii = KeyAscii - 32
End Select
Char = Chr(KeyAscii)
Set RSSQL = New ADODB.Recordset
RSSQL.Open "Select * from Table_FILE where itemcode like '" & Char & "*'", , adOpenDynamic, adLockOptimistic
Set DataGrid.DataSource = RSSQL
DataGrid.HoldFields
DDataGrid.Refresh
MsgBox Char
End Sub
but it return error when i run it.
I'm using adodb for my sql database, I have a text box where try to code it as search fields, when the user key-in the textbox it will auto display the listbox which attache as follow and it will search by every single character.
the example code are:
Private Sub txtFCode_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 97 To 122: KeyAscii = KeyAscii - 32
End Select
Char = Chr(KeyAscii)
Set RSSQL = New ADODB.Recordset
RSSQL.Open "Select * from Table_FILE where itemcode like '" & Char & "*'", , adOpenDynamic, adLockOptimistic
Set DataGrid.DataSource = RSSQL
DataGrid.HoldFields
DDataGrid.Refresh
MsgBox Char
End Sub
but it return error when i run it.