I'm, trying to navigate through my records but when I press the buttons, nothing happens. I'm using Jet 4.0 and an Access DB.
I'm not sure what I'm doing wrong but if anyone can help me in the right direction, it would be appreciated.
Code:
Private Sub showData(ByVal CurrentRow)
CurrentRow = 0
Dad.Fill(dst, "patrolDB")
TextBox27.Text = dst.Tables("patrolDB").Rows(CurrentRow)("ID").ToString.ToUpper
DateTimePicker1.Text = dst.Tables("patrolDB").Rows(CurrentRow)("patroldate").ToString.ToUpper
TextBox2.Text = dst.Tables("patrolDB").Rows(CurrentRow)("patroltime").ToString.ToUpper
ComboBox1.Text = dst.Tables("patrolDB").Rows(CurrentRow)("patroltype").ToString.ToUpper
ComboBox2.Text = dst.Tables("patrolDB").Rows(CurrentRow)("patrolsite").ToString.ToUpper
ComboBox4.Text = dst.Tables("patrolDB").Rows(CurrentRow)("patrolloc").ToString.ToUpper
ComboBox3.Text = dst.Tables("patrolDB").Rows(CurrentRow)("patrolofficer").ToString.ToUpper
RichTextBox1.Text = dst.Tables("patrolDB").Rows(CurrentRow)("patrolnotes").ToString.ToUpper
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
If CurrentRow <> dst.Tables("patrolDB").Rows.Count - 1 Then
CurrentRow += 1
showData(CurrentRow)
End If
MsgBox("You've reached the last record.")
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
index = 0
showData(CurrentRow)
End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
If CurrentRow <> 0 Then
CurrentRow -= 1
showData(CurrentRow)
End If
MsgBox("You've reached the first record.")
End Sub
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
CurrentRow = dst.Tables("patrolDB").Rows.Count - 1
showData(CurrentRow)
End Sub