i am having some problem in navigating records...
when i am moving any record next, it moves record by record nect,and also it moves previous,but when i either press last or first, then these both next and previous button do not work..
here is a code.
Private Sub movefirst1_Click()'it is working very fine
Call MyDatacon
Set RS = New ADODB.Recordset
RS.Open "SELECT * From CUSTOMER", con, adOpenStatic, adLockOptimistic
RS.MoveFirst
txtcode1.Text = RS!Customercode
txtshopname = RS!shopname
Call Search
RS.close
con.close
End Sub
Private Sub movelast1_Click() 'it is also working fine
Call MyDatacon
Set RS = New ADODB.Recordset
RS.Open "SELECT * From CUSTOMER", con, adOpenStatic, adLockOptimistic
RS.MoveLast
txtcode1.Text = RS!Customercode
txtshopname = RS!shopname
Call Search
RS.close
con.close
End Sub
Private Sub movenext1_Click()it doesn't work when i am pressing move first
On Error GoTo Err
Call MyDatacon
Set RS = New ADODB.Recordset
RS.Open "SELECT * FROM Customer", con, adOpenStatic, adLockOptimistic
RS.AbsolutePosition = xbookmark
RS.MoveNext
txtcode1.Text = RS!Customercode
txtshopname = RS!shopname
Call Search
xbookmark = xbookmark + 1
RS.close
con.close
Exit Sub
Err:
'End of file was reached, exit sub
'MsgBox "Last Record"
Exit Sub
End Sub
Private Sub movepre1_Click()'it doesn't work when i am preesing movelast.
On Error GoTo Err
Call MyDatacon
Set RS = New ADODB.Recordset
RS.Open "SELECT * FROM Customer", con, adOpenStatic, adLockOptimistic
RS.AbsolutePosition = xbookmark
RS.MovePrevious
txtcode1.Text = RS!Customercode
txtshopname = RS!shopname
Call Search
xbookmark = xbookmark - 1
RS.close
'If rs.BOF Then
'MsgBox "First Record"
con.close
Exit Sub
Err:
End Sub