filters and number of records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have forms that I have created which have filters on them to only display
certain records. What I am trying to do get the number of records that get
passed through these filters. I have applied the filters in the properties
of Access and I am trying ot get the number of records within the code that I
am writing to use somewhere else.

I am using Access 2000.

Thanks
 
Sorry...this is the code that I have...it should be so simple...I'm sure I'm
just missing something simple.

Dim theRecSet As RecordSet

Set theRecSet = Fprms![Subjects_RankUnder7].RecordsetClone *****this is the
line that has the type mismatch error

If theRecSet.RecordCount <> Then
theRecSet.MoveLast
End IF

MsgBox theRecSet.RecordCount

The form I am usins is named Subjects_RankUnder7, which had a filter applied
on it through the properties.

I don't know if you can help. Thanks for all of your suggestions so far.



Ofer said:
Did you declare the Dim MySet As Recordset


R said:
sorry the error that i keep getting is on the line
"Set MySet = Forms![FormaName].RecordsetClone"
i put set MySet = Me.RecordsetClone
it says its a type mismatch error
thanks
 
From what I see you wrote

Set theRecSet = Fprms![Subjects_RankUnder7].RecordsetClone *****this is the
It should be
Set theRecSet = Forms![Subjects_RankUnder7].RecordsetClone

the Fprms should be Forms
R said:
Sorry...this is the code that I have...it should be so simple...I'm sure I'm
just missing something simple.

Dim theRecSet As RecordSet

Set theRecSet = Fprms![Subjects_RankUnder7].RecordsetClone *****this is the
line that has the type mismatch error

If theRecSet.RecordCount <> Then
theRecSet.MoveLast
End IF

MsgBox theRecSet.RecordCount

The form I am usins is named Subjects_RankUnder7, which had a filter applied
on it through the properties.

I don't know if you can help. Thanks for all of your suggestions so far.



Ofer said:
Did you declare the Dim MySet As Recordset


R said:
sorry the error that i keep getting is on the line
"Set MySet = Forms![FormaName].RecordsetClone"
i put set MySet = Me.RecordsetClone
it says its a type mismatch error
thanks
 
It sounds like you have a reference to ADO and not DAO. In the code
editor, go to Tools->References and check Microsoft DAO 3.6. If you
aren't using ADO/ don't know what ADO is, remove the reference to
Microsoft ActiveX Data Objects #.# . If you want to keep both
libraries, make sure that you are explicit in the declaration of objects
that are in both libraries:

Dim MySet as DAO.Recordset ' A form's RecordsetClone property returns a
DAO.Recordset object

HTH,
 
Back
Top