Private Sub NavSearchBtnLoad_Click(sender As System.Object, e As System.EventArgs) Handles NavSearchBtnLoad.Click 'General Declarations Dim DB_REC_CNT As Int16 = LoadInfoDataSet.Load_Info_Table.Count 'Counts Records in Database Dim SrchVal As String = SrchLoadInputAll.Text 'This is Load Number your searching for Dim IdVal As Integer 'ID of record found Dim SrchResult As Boolean = False 'Did search pass/fail default is fail Dim LoopCnt As Int16 'Loop integer 'Perform Search For LoopCnt = 0 To DB_REC_CNT - 1 ' Loops thru listboxes searching for the load number Try If LoadInfoDataSet.Load_Info_Table.Item(LoopCnt).PETS_LOAD_NUMBER = SrchVal Then SrchResult = True If LoadInfoDataSet.Load_Info_Table.Item(LoopCnt).PRIME_LOAD_NUMBER = SrchVal Then SrchResult = True If SrchResult = True Then IdVal = LoopCnt LoopCnt = DB_REC_CNT - 1 ' Stops searching before end of list if found End If Catch ex As Exception End Try Next Try If SrchResult = False Then ' Display a message box notifying users the record cannot be found. If MessageBox.Show("NO RECORD FOUND. PLEASE RETRY YOUR SEARCH", "P.E.T.S. DATA MANAGEMENT SYSTEM", _ MessageBoxButtons.OK, MessageBoxIcon.Information) _ = DialogResult.OK Then End If Exit Sub End If Catch ex As Exception End Try 'Copy ID to Navigator and Run Try Dim ID As String = LoadInfoDataSet.Load_Info_Table.Item(IdVal).ID BindingNavigator1.PositionItem.Text = ID 'Code For clicking to go to selected record BindingNavigatorPositionItem.Focus() BindingNavigator1.Focus() BindingNavigator1.Update() Catch ex As Exception End Try End Sub
BindingNavigator1.PositionItem.Text
BindingNavigator1.BindingSource.Position
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)