Awesome!!!
Thank you pbaldy
Exactly what i needed.
Anyone following the same logic like me (set focus on current record on subform) , below is the way i did it:
Code:
Private Sub SetFocusOnCurrentRec()Dim lngPK As Integer
lngPK = Me.InvID_PK
[Forms]!
[ListStockInventories].Form.Requery
With [Forms]!
[ListStockInventories].Form.RecordsetClone
.FindFirst "InvID_PK = " & lngPK
If .NoMatch Then
MsgBox "Record not found!", vbCritical
Else
[Forms]!
[ListStockInventories].Bookmark = .Bookmark
End If
End With
End Sub
Then in the afterupdate event of the record editing form you call it:
Code:
Call SetFocusOnCurrentRec
NOTE: if you open the editing form under other circumstances (not only from the continuous form) then, you may consider checking if the continuous form is opened, in order to avoid any error. something like the following:
Code:
If CurrentProject.AllForms("yourcontinuousformname").IsLoaded Then
Call SetFocusOnCurrentRec
End If
i haven't done the checking though, since i don't need it. But i believe it makes sense.