BindingNavigator

Hay,

Whit this code i try to go to a reccord whit an BindingNavigator

Dim ring As String
ring = InputBox("Type een ringnummer", "Ring nummer")
If ring = "" Then
Exit Sub
Else
Me.TVogelBindingNavigator.Items.Find(ring, True)
End If
Is this correct or what do i wrong.



Answer this question

BindingNavigator

  • chen_k

    No i'm not
  • Jannet

    I'm am using this.

    Add a query to the Tableadapter on your form.

    Use SQL statemends.
    SELECT which returns rows.

    then use somthing like this:

    SELECT LocatieID,CompanyName, CompanyAdredss
    FROM LocationTable
    WHERE CompanyName LIKE

    Renamed Fill a DataTable Method name in: FilByCompany
    Renamed Return a DataTable in: GetDataByCompany

    Then

    Add a textbox and a buton to the form.

    Create a button click event.

    enter code:

    Dim CompanyName As String = textboxname.text

    If textboxname.text = "" Then
    Me.TableadapterName.Fill(me.DataSetName.TableName)
    Else
    Me.TableAdapterName.FillByCompany(Me.DataSetName.Tablename, CompanyName)

    The result is that the query takes the string value from the textbox and uses it to search the table. if the textbox is empty the entire tabel is loaded back.

    u can use the % sing as wildcard.

    Hope this helps.

    Sebastiaan



  • marianocab

    Houd je duiven ofzow

    Grtz, Tom.

    PS: Sorry for not speaking English :)



  • AASoft_ILSC

    I use this code in the changed event , but thanks for the RE:

    Dim index As Integer

    Dim zoekstring As String

    zoekstring = Me.BindingNavigatorTextBoxZoeken.Text

    index = TVogelBindingSource.Find("Ring nummer", zoekstring)

    Me.TVogelBindingSource.Position = index

    Me.Invalidate()


  • BindingNavigator