Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numbering rows

Status
Not open for further replies.

woodyinoz

IS-IT--Management
Jan 8, 2002
215
GB
Hi all,

I have a table on a form which is constantly being filtered.
I want to add a field that always shows the row number for that particular filtering. It needs to refresh everytime a filter is set so that the user can always see what row number he/she is on.....
i.e. If I have 25 rows filtered then I want to see 1 to 25 down the side, if I then filter that to only leave me with 5 rows then I want to see 1 to 5 etc...

Any ideas anyone?

Thanks

Woody.
 
Woody,

You can't do that with a filter, but you can do it with a range.

If you're using a range, you can create a calculated field that returns the number of records matching the criteria. Something along these lines should do it:

Code:
tableframe1.nRecords()

Again, this will only work with ranges. If you try this with filters, the result will be "-1".

The only way I know of to accomplish this using filters is to use ObjectPAL to walk through each record and count the matches. THIS IS VERY SLOW.

This is a documented limitation of filters and exists because Paradox doesn't know how many records will match the filter. When you define filters, Paradox locates only the number of matches that it needs to update the screen visually. If your tableframe displays, for example, fifteen records, Paradox only locates fifteen matches and waits until more matches are needed before actually trying to find them.

Ranges, on the other hand, return the full set of matches as soon as they're applied, which is why the calculated field is possible with ranges, but not filters.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top