Keep the focus on the same page when retuns to the form

N

Norbert

How do I keep the same page of a continuos form (frm1)
after refresh from a form (frm2) opened by frm1?

Enclosed is the code I am using to go back to the prior
record but this record shows up in top of the screen in
frm1. For example if the record was in the 5th position it
will jump to the 1st position in the screen.


Code in frm1: cmdAppt_Click()
DoCmd.OpenForm frm1, , , "ApptID=" & me.ApptID
Forms!frm2!txtBackToRecord = Me.CurrentRecord
Forms!frm2.SetFocus


Code in frm2: cmdSave_Click()
With Forms!frm1
.SetFocus
!cmdAppt.SetFocus
.Requery
DoCmd.GoToRecord acDataForm, "frm1", acGoTo,
Me.txtBackToRecord
End With


Thanks
Norbert
 

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