Solved Focus on continuous form

Glad it worked. Again, you may want to look at the Emulated Split form. This provides a lot of functionality and less clutter since you do not have another form open.
 
Generally I thought me.refresh did not requery the underlying data. Me.requery does requery the data, but places the active cursor back to the first record.

So I thought you had to store the current position, requery, and then restore the active cursor to the steed position.
 
Generally I thought me.refresh did not requery the underlying data. Me.requery does requery the data, but places the active cursor back to the first record.

So I thought you had to store the current position, requery, and then restore the active cursor to the steed position.
I believe that was what was suggested
Code:
Public Function PopUpDetails()
  Dim currentID As Long
  currentID = Me.Id  'Save current record id
  'edit record
  DoCmd.OpenForm "frmPopUpDetails", , , "ID = " & currentID, , acDialog
  'requery after edit
  Me.Requery
  'move back to record
  Me.Recordset.FindFirst "ID = " & currentID

End Function

Save record id
edit record
Requery after editing
return to saved record id
 
I think the bit about filters is a red herring.

If you open the popup as a dialog, then code in the calling procedure stops as the popup opens. When the popup closes, control returns to the line after the OpenForm method. That can now be:
Me.Refresh
Which will return the edited value and show it on the subform without requerying which will always move focus back to the first record.

If the popup can add records, then there is a different, more complicated way to solve the problem.
 
I think the bit about filters is a red herring
Yes that is why it took 23 posts to figure out what the real question was
If you open the popup as a dialog
The OP is unfortunately not doing this, for what reason I do not know. Instead the OP is keeping a second edit form open with a save button to push the continuous form to update. My suggestion was if you want to see both the edit/detail form and a continuous form at the same time, it is better to combine them using a "split form" approach instead of two open forms. Because the MS split form is crap, I recommend going with the @isladogs emulated split form.
 

Users who are viewing this thread

Back
Top Bottom