Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move next, Move Previous

Status
Not open for further replies.

giyer555

Programmer
Sep 8, 2003
75
0
0
IN
Hi!! friends

Using ADO after i edit & save a record & move to next record thru rs.movenext the record displays the first record. I close & open the rs after saving to refresh the rs thats the reason it is going to the first record.

Kindly suggest how do i refresh the rs & move to the next record from the edited record when the user clicks the next cmdbutton. The same applies while deleting a record. If i jst use rs.movenext after deleting the record the rs is not refresh.

Pls guide.

Thanx & regards,
 
Use a loop after you refresh to loop through using rs.movenext until you find the current record number

Public Position as Integer

Whenever you move through a recordset Position = Position + 1, so we now where we are (clear if changing recordset)

Delete your item, then

After refreshing...

Dim x As Integer
With YourRecordSet
.MoveFirst
Do Until x = Position
x = x + 1
.MoveNext
DoEvents
Loop
End With

Dont forget to add some error handling! Hope this helps :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top