Paul Cronin

Paul Cronin

  • NA
  • 1
  • 0

Record Navigation System

Dec 5 2007 10:08 AM

I have a delete button that deletes two records at a time for some reason. Also i have a next and previous button that jump to every second record instead of the next. here is the code i have for them if anyone knows what i am doing wrong:

[code]Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
        Dim index As Integer = cboSNameView.SelectedIndex
        myDs.Tables("dtClients").Rows(index).Delete()
        oleDbDataAdapter1.Update(myDs, "dtClients")
        cboSNameView.Items.RemoveAt(index)
        currentRow = 0
        showData()
        MessageBox.Show("Record successfully deleted!")
    End Sub[/code]
[code]Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
        If currentRow < myDs.Tables("dtClients").Rows.Count - 1 Then
            currentRow += 1
        End If
        showData()
    End Sub
[/code]
[code]Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
        If currentRow > 0 Then
            currentRow -= 1
        End If
        showData()
    End Sub
[/code]