Conuting records?

  • Thread starter Thread starter JethroUK©
  • Start date Start date
J

JethroUK©

I'm having trouble displaying a forms record count (it varies depending upon
the filter chosen and is refreshed according ly):

Requery
lblCount.Caption = Recordset.RecordCount

was working fine until recently - now it just reports "1"

i've tried movelast, movefirst which does work - albiet it flickeres the
screens 'twice' - even if i count a clone

is there a better way to count the records on a form?
 
JethroUK© said:
I'm having trouble displaying a forms record count (it varies depending
upon
the filter chosen and is refreshed according ly):

Requery
lblCount.Caption = Recordset.RecordCount

was working fine until recently - now it just reports "1"

i've tried movelast, movefirst which does work - albiet it flickeres the
screens 'twice' - even if i count a clone

Dont' use clone..but recordsetclone...

me.RecordSetClone.MoveLast
lblCount.Catpion = me.ReocrdSetClone.RecordCount

Note the difference between

me.Recordset . Clone

and

Me.RecordSetClone

They have a very different meaning. the me.RecordSet.Clone means to make a
clone of the existing reordset (it is a "method" that "clones" the
reocrdset. This can be used for any reocrdset, and even a reocrdset that is
NOT part of a form. However, if you "clone" a reocredset attached to a form,
then if you move the recordpointer, the form will move.

If you use recordsetclone, then this is a built-in clone that ALREADY exists
for your use (using the recordset clone does not "copy", or "make a copy"
when you use it. (so , this reocrdsetclone can be used, processed, and
moving though records does NOT effect the form, or make the form move).
 
Albert D.Kallal said:
Dont' use clone..but recordsetclone...

me.RecordSetClone.MoveLast
lblCount.Catpion = me.ReocrdSetClone.RecordCount

Note the difference between

me.Recordset . Clone

and

Me.RecordSetClone

They have a very different meaning. the me.RecordSet.Clone means to make a
clone of the existing reordset (it is a "method" that "clones" the
reocrdset. This can be used for any reocrdset, and even a reocrdset that is
NOT part of a form. However, if you "clone" a reocredset attached to a form,
then if you move the recordpointer, the form will move.

If you use recordsetclone, then this is a built-in clone that ALREADY exists
for your use (using the recordset clone does not "copy", or "make a copy"
when you use it. (so , this reocrdsetclone can be used, processed, and
moving though records does NOT effect the form, or make the form move).

Super job

i now use:

With RecordsetClone
.MoveLast
lblCount.Caption = .RecordCount
End With

no form flicker - i've found i dont even need to requery using this method

Thanks
 
Back
Top