We help IT Professionals succeed at work.
Get Started

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

mlcktmguy asked
Last Modified: 2020-02-19
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
    gBogusLong1 = Me.RecordsetClone.RecordCount
    If Me.RecordsetClone.RecordCount > 0 Then  'only do this if records exists.
        ' 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

Open in new window

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.
Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE