>Hi all
>I want to have a column in my grid to show records number.
>I dont want to have a field in my cursor for this counter.
>I want when i ADD or DELETE a record from grid, the counter rearranged.
>Can i do this?
>Thanks for your suggestion
You could use the recno() function, and base the grid on a view.
However, deleting a record would require to refresh the view, to update the record numbers.
Another option, if you have few records, is a UDF which counts the records from the top of the table. For a lot of records, this would be too slow.
Also, perhaps you should reconsider adding an additional field. For instance, in one case, I automatically put numbers, in increments of 10 (10, 20, 30, ...). The user could re-order the rows, by changing the numbers (for instance, to put the third row before the second, change the "30" to "15"). A "renumber" button on the form would "clean up" the numbers, i.e., make the first record equal to 10, the second to 20, etc.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)