maggiemel
Posts: 75
|
Posted: 04/28/2004, 6:47 PM |
|
Hello everybody! I am retrieving records from a db, ordering them by a date field. The users would like to have the records numbered on the fly, so that if a record with an earlier date is entered, the returned data will be renumbered to reflect the change.
I know how to use the FormName.DataSource.Recordset.RecordCount to get the total number of records, but I can't seem to figure out how to use that value in my BeforeShowRow statement to create a label with a value that I can increment for each row. Am I clear? I want to simply number the records once they've been retrieved in date order.
Any help is appreciated, as always...
_________________
Melissa Cahill
http://www.hellcatmaggie.net/ |
|
|
peterr
Posts: 5971
|
Posted: 04/28/2004, 9:54 PM |
|
I'm not sure how you'd use the FormName.DataSource.Recordset.RecordCount because then you would start the counter with your last record and increase it?
I imagine that you'd rather want to start with #1 (or any other number) instead of the total/count, and then increase it.
Therefore create a global variable that contains "1", like:
MyCount = 1
Then display it in the Label and increase it in the Before Show event.
You can create global variables by placing them outside of functions or events, for example between 2 events, or at the beginning of the _events.asp file, or at the beginning of Page.asp.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
maggiemel
Posts: 75
|
Posted: 04/29/2004, 6:22 AM |
|
Doink! Of course, that's so simple.
Thank you.
_________________
Melissa Cahill
http://www.hellcatmaggie.net/ |
|
|
|