J
John F
Following routine executes in response to a custom event raised from another
form. Creates RecordSetClone, uses FindFirst to locate a specific record,
and then sets form’s RecordSet bookmark to equal RecordSetClone’s bookmark.
When form filter property is not set, this works fine, but when the form’s
filter property is set, I get an Run-time Error 2455 – You entered an
expression that has an invalid reference to the property |.
This error occurs at the statement: Me.Bookmark = rsCdrl.Bookmark
I’m fairly sure that the record found by FindFirst is consistent with the
form’s filter.
Any ideas why this is not working when the form is filtered. (I have search
for 2455 but do not find the issues already raised pertain to this.)
Thanks,
John
----------------------------------------------
Private Sub frmSub_MoveSubm(strSeqNo As String)
'Respond to the MoveSubm event on frmSubmissions
'Save the strSeqNo passed
Dim rsCdrl As Recordset
If Not IsNull(strSeqNo) Then
'Save before move
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set
Set rsCdrl = Me.RecordsetClone
rsCdrl.FindFirst "[chrSeqNo] = " & "'" & strSeqNo & "'"
If rsCdrl.NoMatch Then
MsgBox "Problem with string---jf"
Else
'Display the found record in the form.
Me.Bookmark = rsCdrl.Bookmark
End If
Set rsCdrl = Nothing
End If
End Sub
form. Creates RecordSetClone, uses FindFirst to locate a specific record,
and then sets form’s RecordSet bookmark to equal RecordSetClone’s bookmark.
When form filter property is not set, this works fine, but when the form’s
filter property is set, I get an Run-time Error 2455 – You entered an
expression that has an invalid reference to the property |.
This error occurs at the statement: Me.Bookmark = rsCdrl.Bookmark
I’m fairly sure that the record found by FindFirst is consistent with the
form’s filter.
Any ideas why this is not working when the form is filtered. (I have search
for 2455 but do not find the issues already raised pertain to this.)
Thanks,
John
----------------------------------------------
Private Sub frmSub_MoveSubm(strSeqNo As String)
'Respond to the MoveSubm event on frmSubmissions
'Save the strSeqNo passed
Dim rsCdrl As Recordset
If Not IsNull(strSeqNo) Then
'Save before move
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set
Set rsCdrl = Me.RecordsetClone
rsCdrl.FindFirst "[chrSeqNo] = " & "'" & strSeqNo & "'"
If rsCdrl.NoMatch Then
MsgBox "Problem with string---jf"
Else
'Display the found record in the form.
Me.Bookmark = rsCdrl.Bookmark
End If
Set rsCdrl = Nothing
End If
End Sub