Fordraiders
asked on
Navigation in dataset going backwards when asking to go next
vb.net 2003
access 2003 backend
loading the dataset via code: no textboxes are bound...all are unbound..
Dim das1 As New System.Data.DataSet()
Dim cnn1 As New OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OL EDB.4.0;" & _
"Data Source=c:\Program Files\" & _
"Crs_iCart\Beta_2010_Crs_i Cart.mdb")
Dim query As String = "SELECT * FROM tblMainData Order By MainTableID DESC "
Dim dap1 As New System.Data.OleDb.OleDbDat aAdapter(q uery, cnn1)
Problem:
The data loads as I ask: the Maintable id is descending.
so If I have 21 records record id "21" shows up
Weird Part:
When I press the "next" it should do nothing..
But The records go to the previous record ?
21..20..19 etc...
When I press "previous" it does nothing ?
Thanks
fordraiders
access 2003 backend
loading the dataset via code: no textboxes are bound...all are unbound..
Dim das1 As New System.Data.DataSet()
Dim cnn1 As New OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OL
"Data Source=c:\Program Files\" & _
"Crs_iCart\Beta_2010_Crs_i
Dim query As String = "SELECT * FROM tblMainData Order By MainTableID DESC "
Dim dap1 As New System.Data.OleDb.OleDbDat
Problem:
The data loads as I ask: the Maintable id is descending.
so If I have 21 records record id "21" shows up
Weird Part:
When I press the "next" it should do nothing..
But The records go to the previous record ?
21..20..19 etc...
When I press "previous" it does nothing ?
Thanks
fordraiders
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
'Move to next position
Me.BindingContext(das1, "tblMainData").Position += 1
End Sub
Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
'Move to previous position
Me.BindingContext(das1, "tblMainData").Position -= 1
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.