Not sure if this post needs to go in the Modules & VBA section, but here goes.
This error is driving me crazy and I hope there is someone that will help me out.
I've got a form with a list box displaying few thousand records depending on the search criteria. The user can then double click the desired record and another form will appear where the selected record can be edited.
The double click event looks as follow:
The id is passed to the "gotoid" function by Me.lstSearch to update the frmReturn_Header form with the selected id's detail.
The problem comes in when it hits the function and specifically the "Me.Bookmark = .Bookmark" section of code:
I get the Run-time error '3021':
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
I don't get it as I'm the only one working on the db (on my local machine) and the record physically exists in the table. I've checked a few to make sure.
And best of all is that it's only for specific records; the majority of records work 100%.
There must be something in my code I'm missing.
Hope you guys will be able to help as I'm loosing hair by the second with this.
This error is driving me crazy and I hope there is someone that will help me out.
I've got a form with a list box displaying few thousand records depending on the search criteria. The user can then double click the desired record and another form will appear where the selected record can be edited.
The double click event looks as follow:
Code:
Private Sub lstSearch_DblClick(Cancel As Integer)
Const FN As String = "frmReturn_Header"
DoCmd.OpenForm FN
Forms(FN).gotoid Me.lstSearch
End Sub
The id is passed to the "gotoid" function by Me.lstSearch to update the frmReturn_Header form with the selected id's detail.
The problem comes in when it hits the function and specifically the "Me.Bookmark = .Bookmark" section of code:
Code:
Public Function gotoid(formid As Long) As Boolean
With Me.RecordsetClone
.Find "Return_ID = " & formid
gotoid = True
Me.Bookmark = .Bookmark
End With
End Function
I get the Run-time error '3021':
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
I don't get it as I'm the only one working on the db (on my local machine) and the record physically exists in the table. I've checked a few to make sure.
And best of all is that it's only for specific records; the majority of records work 100%.
There must be something in my code I'm missing.
Hope you guys will be able to help as I'm loosing hair by the second with this.