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

Repositioning Cursor!!!!

Status
Not open for further replies.

legs00

Programmer
Oct 17, 2001
36
CA
Hi,

I am having a problem...whenever I delete a record in my subform and the subform requeries my cursor is positioned at the first record of the recordset. Is it possible to position the cursor at the recorde previous the one that is being deleted??? If so, how do I do this. I tried the bookmark but it is not working!! Maybe it is the way my code is written.

Can anyone help me!!!

Patty
 
A method i have not tried but should have no probs working is to add the follwoing line to your delete button.

DoCmd.GoToRecord , , acLast


If you then want it to go to a specific field in the last record add this below the above code.

Forms!formname!fieldname.SetFocus

hope this helps

zero
 
Hi Zeroanarchy,

Well I tried what you said but it still doesn't work. This is the thing, I have this subform that displays records according to certain criterias. Now I can select the record I would like to delete and press the delete button. The problem is when the record get deleted, the recordset gets requeried and repositions thecursor to the first record. What I want to do is reposition the cursor to the record just before(above) the one that I deleted.

Is it possible to do this?

Legs
 
Anything is possible.

Ok I will just make sure you are putting this in the correct place.

DoCmd.GoToRecord , , acLast

If it is a subform that you are deleting records from, goto the original form and in the ON DELETE event put it in there.

Let me know how you go.

Zero :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top