Set Focus on last record

K

Karen

In a subform which is in 'continuous forms' mode, I want to programmatically set the selection to the last record displayed in the subform. I have tried:

DoCmd.GoToRecord , , acLast

and I get the following error

"You can't use the GoToRecord action or method on an object in Design view."

This is not in Design view so the error doesn't help point to the problem. Any help is appreciated.
 
P

Pavel Romashkin

If you are trying to do it from the main form, try

Me.Subform.Form.Recordset.MoveLast

if you are in the subform, simply

Me.Form.Recordset.MoveLast

Hope this helps,
Pavel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top