After Update: Go to new record

G

Guest

Hello.
I have form with a subform. On my subform object I have an Event Procedure
on "After Update". The Event Procedure has this:

Private Sub Form_AfterUpdate()
Me.Requery

End Sub

This Event Procedure basically refreshes the subform after I edit a record.
The problem I have with it is after I update a record, the records refresh
but my cursor gets moved all the way to the first record in the subform. I
would like my cursor to go to a new record in the subform instead.

I have tried but I get a compile error:

Private Sub Form_AfterUpdate()
Me.Requery
Me.NewRecord

End Sub

Would you know how to modify the Event Procedure to take me to a new record
after requerying the subform?

Iram/mcp
 
S

Steve

GREAT Maurice!

It is working for me too: add new record to 2nd subform...

Form.SetFocus & DoCmd.GoToRecord , , acNewRec is not working - try it! Just
need to use "If Then" becuse it is not working if you do not have any record
on a subform.

Thanks,
Steve,
Hungary
 

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