I have a form with a continious subform in it.
The subform is based on a query.
When I doubleclick a record I retrieve its recordnumber and then it will be deleted from the query.
When I do a requery the first record is selected but I want to go back to the record with the retrieved recordnumber (that means the record which was right after the record I deleted)
I tried this :



code:--------------------------------------------------------------------------------

Private Sub Form_DblClick(Cancel As Integer)
Dim clickedRecord as Integer

clickedRecord = Me.currentRecord

'HERE COMES THE CODE TO DELETE THE CLICKED RECORD

Me.Requery

DoCmd.GoToRecord acDataForm, Me.Name, acGoTo, clickedRecord
End Sub

--------------------------------------------------------------------------------


It gives me error 2489: The object frmForm is not opened.

If I do this on a standalone form it works perfectly, but if the form is used as a subform it doesn't.

What am I missing?