Continuous form.......  Would like to have the last 7 records in view after I use command        DoCmd.GoToRecord , , acLast:

peispud
peispud used Ask the Experts™
on
Hi

I am using a continuous form.

DoCmd.GoToRecord , , acLast:     gets you to the last record.

But, when  I programmatically add a record on my continuous form  and use this command,  the only record that I see  is the last record.

I would like to see (by example) 10 records above the last record.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017
Commented:
It might be easier if you sorted the recordset in descending order.  Requery in the Form's AfterUpdate event to reposition back to the "top" of the recordset.  That will keep as many records visible as will fit on the form.
John TsioumprisSoftware & Systems Engineer

Commented:
How about doing a
Me.Requery 

Open in new window

after you have inserted the record and use the same command to move to the last Record
DoCmd.GoToRecord , , acLast

Open in new window

peispudTech

Author

Commented:
Thank you for your answers.
PatHartman's answer is a rethink of the problem. Perfect answer!
Mark EdwardsChief Technology Officer

Commented:
Here's a little demo of how you can get datasheet and continuous form records into view/position without resorting your records.  Involves the records in subforms.
RepositionSubformRecords.accdb

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial