Subject | Re: [IBO] TIBOTable, Filtered, and RecordCount |
---|---|
Author | Jason Wharton |
Post date | 2002-09-20T01:03:37Z |
RecordCount is only accurate when using OnFilterRecord if all records are in
the buffer. Call FetchAll prior to accessing RecordCount to make sure it is
accurate.
Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
the buffer. Call FetchAll prior to accessing RecordCount to make sure it is
accurate.
Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
----- Original Message -----
From: "Joe Martinez" <joe@...>
To: "IB Objects" <IBObjects@yahoogroups.com>
Sent: Thursday, September 19, 2002 2:13 PM
Subject: [IBO] TIBOTable, Filtered, and RecordCount
> I have a TIBOTable object that is filtered. At the start of my app, I
> examine the RecordCount property of the table and use it to update a label
> on the screen. I also re-examine it in the OnDataChange event and update
> the label as well.
>
> At the beginning of my app, I examine the RecordCount property, and the
> count includes ALL records in the table, NOT just the ones that pass the
> filter (determined by the OnFilterRecord event). Later on, after the app
> is underway, the RecordCount DOES report the correct number of (filtered)
> records, so there's obviously a timing issue here.
>
> It's like at the beginning of my app (I've tried putting the code in the
> main form's OnShow event handler, as well as the table's AfterOpen event
> handler), the records aren't being filtered yet, so it incorrectly gets
the
> unfiltered count.
>
> When does the filter get put into effect, so that RecordCount shows the
> correct number of records?
>
> Where can I put my code (to be run at program start up) so that Record
> Cound will report the correct number of FILTERED records?
>
> Thanks,
> Joe