I have a simple form with a ListView (populated with about 2800 supplier names).
These names are resident in a dataset as a result of an SQL select statemet.
The user could simply scroll through the list of suppliers until he finds the one he is looking for (users are complaining that this takes too long) or they could select the ListView, then key in the first character of the supplier name and ListView will select the first supplier that starts with the character keyed in.
One character, however, is not enough. the users wish to be able to type more characters and get closer to the supplier name.
To achieve this I have included a "Quick Search" TextBox where they can do just that.
The plan is to take each character keyed in and select from the dataset into a DataRow (or dataRows) and get the Rowid/s and select or multiselect the matching items on the ListView.
The HUGE problem that I'm having is that I cannot seen to access the DataRow _Rowid (I can see it in debug mode)
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Ssql = "SELECT SP_Name from Supplier Where SP_Name <> ' Select Supplier' ORDER BY SP_Name"
da = New OleDb.OleDbDataAdapter(Ssql, cn)
For x = 0 To ds.Tables("Suppliers").Rows.Count - 1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Dim RowNumber As String
RowNumber = CStr(GetRowNumbers(TextBox1.Text))
Private Function GetRowNumbers(ByVal theSupplier As String) As String
Dim Table As DataTable = ds.Tables("Suppliers")
Dim Expression As String
Dim FoundRows() As DataRow
Expression = "SP_Name LIKE '" & theSupplier & "%'"
FoundRows = Table.Select(Expression)
If FoundRows.Count = 0 Then
Return "Nothing Found"
Can anyone please advise how could do this.
Once again, many thanks.