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.
ItemsTableAdapt er 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.IsNullO rEmpty(Me.Reche rche.Text) = False) Then
Dim rech_str As String = Me.Recherche.Te xt
Me.ItemsTableAd apter.ClearBefo reFill = True
Me.ItemsTableAd apter.FillBy_nm _latin(Me.Signs DataSet.items,
rech_str)
End If
Once this code has executed, the BindingNavigato rchangedItem 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.SignsDataSe t.items.Rows(Me .ItemsBindingSo urce.Position). IsNull("No") =
False) Then
Me.NoKey =
Me.SignsDataSet .items.Rows(Me. ItemsBindingSou rce.Position).I tem("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
ItemsTableAdapt er.
Any hint on how to do this will be appreciated.
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.
ItemsTableAdapt er 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.IsNullO rEmpty(Me.Reche rche.Text) = False) Then
Dim rech_str As String = Me.Recherche.Te xt
Me.ItemsTableAd apter.ClearBefo reFill = True
Me.ItemsTableAd apter.FillBy_nm _latin(Me.Signs DataSet.items,
rech_str)
End If
Once this code has executed, the BindingNavigato rchangedItem 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.SignsDataSe t.items.Rows(Me .ItemsBindingSo urce.Position). IsNull("No") =
False) Then
Me.NoKey =
Me.SignsDataSet .items.Rows(Me. ItemsBindingSou rce.Position).I tem("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
ItemsTableAdapt er.
Any hint on how to do this will be appreciated.
Comment