I am working on a form (details) and I need my form to allow to search on
some char fields.
I have a button next to the field users can search. The button calls a
pop-up form to enter the string to search.
ItemsTableAdapter is the table adapter used for the form.
I have 1863 records in the Items table. My goal is to show only the records
matching the string using the same form.
I have modified the DataSet to add a query using a parameter:
SELECT No, Type, ..... Interest3 FROM items where nm_latin like
@srch_nm_latin order by nm_latin
This code is executed when I return from the pop-up. The string contain a
string. Example: "thing%"
If (String.IsNullOrEmpty(Me.Recherche.Text) = False) Then
Dim rech_str As String = Me.Recherche.Text
Me.ItemsTableAdapter.ClearBeforeFill = True
Me.ItemsTableAdapter.FillBy_nm_latin(Me.SignsDataS et.items,
rech_str)
End If
Once this code has executed, the BindingNavigatorchangedItem function is
called and I need to get the key values I am not displaying in the form:
' Load the key values in the form field variables
If
(Me.SignsDataSet.items.Rows(Me.ItemsBindingSource. Position).IsNull("No") =
False) Then
Me.NoKey =
Me.SignsDataSet.items.Rows(Me.ItemsBindingSource.P osition).Item("No") '
ERROR
Else
Me.NoKey = 0
End If
I have seen examples where a new TableAdapter is used for search. I don't
know how I could do that since my form is all built on the
ItemsTableAdapter.
Any hint on how to do this will be appreciated.