MartyConnelly
martyconnelly at shaw.ca
Tue Dec 20 00:14:08 CST 2005
Don't use absoluteposition unless familar with it, it also includes deleted records in its count. Also you are putting a text field into a long number rs.AbsolutePosition = txtCardNo.Text instead use something like rs.Find "work_order_no = " & txtCardNo.Text For info look up find in ado260.chm help file Kim Wiggins wrote: >Can anyone possibly tell me why my MovePrevious and MoveNext buttons in my Access db does not move one record at a time when I am using it on a large dataset? When I use it on a large dataset of 200 or more records the MovePrevious will move back 3 records and then if you select MoveNext it will move ahead 5 records. Any dataset with less than 200 records it works fine. I will query on the workorder number in the table and then the workorder is divided even further into card numbers. For example: WO 156 has 400 card records. I then perform a search for the workorder - card number that I want and then from there I use the move previous or move next button. Here is my code for move previous: > Thanks > Kim > > > On Error GoTo SubErr > Dim i As Integer > Dim rs As ADODB.Recordset > > Set oConn = New ADODB.Connection > oConn.Open frmSplash.sConn > > strSQL = "select * from tblAircraftWO where work_order_no = " & txtWorkOrderNo.Text > > Set rs = New ADODB.Recordset > rs.Open strSQL, oConn, adOpenKeyset, adLockOptimistic > > rs.AbsolutePosition = txtCardNo.Text > > rs.MovePrevious > > If Not rs.BOF Then......... > //the rest of this code is to display the record in the interface > > If rs.BOF Then > rs.MoveFirst > MsgBox "You are at the beginning." > End If > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com > > -- Marty Connelly Victoria, B.C. Canada