I am trying to implement a Find button in my form.
There are 2 text boxes : one for part code and the other for part seq number and 2 Find buttons, one for each of the above.
Here is my code:
Is it possible for me to set the code where there is only 1 button and 1 textbox that the code will read the input values of part code and seq number?Code:Public Class MRP_Planning Private Sub Part_Planning_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.PartsTableAdapter.Fill(Me.PartDataSet.Parts) End Sub Private Sub btnFindSeqNo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFindSeqNo.Click Dim indexNumber As Integer = Me.PartsBindingSource.Find("SequenceNumber", Me.FindBySequenceNo.Text) Me.PartsBindingSource.Position = indexNumber End Sub Private Sub btnFindPartCode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFindPartCode.Click Dim indexNumber As Integer = Me.PartsBindingSource.Find("PartCode", Me.FindByPartCode.Text) Me.PartsBindingSource.Position = indexNumber End Sub End Class




Reply With Quote