troubleshooting Question

run time error 7951 "You entered an expression that has an invalid reference to the recordset clone property

Avatar of mlcktmguy
mlcktmguyFlag for United States of America asked on
Microsoft Access
4 Comments1 Solution59 ViewsLast Modified:
I am getting run time error 7951 "You entered an expression that has an invalid reference to the recordset clone property., on this statement

gBogusLong1 = Me.RecordsetClone.RecordCount  whic is part of this code block

Private Sub Form_Current()
  
If Me.NewRecord Then        'should never be a new record on this form
Else
    gBogusLong1 = Me.RecordsetClone.RecordCount
    '
    If Me.RecordsetClone.RecordCount > 0 Then  'only do this if records exists.
        'clone
        ' Set up globals for the current tax record, different id's are on it.
        '
        gCurrGRBID = Nz(Me.GRBID, 0)
        '
    End If
    '
End If
'

End Sub

I copied this code block from another Access 2013 application, where it works with no issues. .

The purpose of the code is to save off the ID of the first record on the continuous screen after a requery but only if there is a record.  If the returned recordset has no records I want to bypass the setting of the ID.

Any ides why I am getting this error in this application but not the other.  Or, Is there a better way to accomplish what I am trying to do?


If I try to type the command in using the intellisense there definitely in no 'Recordcount' option available.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros