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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RecordSet Navigation

Status
Not open for further replies.

rookery

Programmer
Apr 4, 2002
384
GB
Can anyone tell me why the following deletion code seems to move me one record forward after deleting the said record? Is it something to do with the current pointer?

Dim myrs As Recordset

If MsgBox("Do You Want To Delete The Record?", 4, "Deletion?") = 6 Then
Set myrs = Me.RecordsetClone
With myrs

.Bookmark = Me.Bookmark
.Delete

End With
MsgBox "Record is Deleted!!", 64, "No Turning Back!!"
End If
myrs.MovePrevious
myrs.Close



 
You are confusing the recordset clone you are working on with the cursor on the form itself. In place of myrs.moveprevious use
DoCmd.GoToRecord acDataForm, "myForm", acPrevious
where my form is the name of the form you are calling the function from.
Hope this helps ...T
 
TMan thanks for your help. It works a treat! Out of curiousity I was under the impression that setting MyRs.Bookmark = Me.BookMark would synchronise the two Recordsets and thus move the pointer on the Form backwards, when instructed too. Can you shed any light...?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top