advlegals
asked on
Access Tabular Form - Row Numbering
I have a tabular form which displays annual data in month blocks.
The form has a sort function on it and I can sort on all months Desc.
I'm trying to add a field onto the form that'll number rows from 1.. Please bear in mind that when the recordset is re-sorted the row numbering needs to remain static, running from 1.. to the bottom of the form.
This, on the face of it, would seem like a simple thing to accomplish. I can return a row number from a click event by using Me. CurrentRecord but I can't assign this to my row counter text box at runtime.
The form has a sort function on it and I can sort on all months Desc.
I'm trying to add a field onto the form that'll number rows from 1.. Please bear in mind that when the recordset is re-sorted the row numbering needs to remain static, running from 1.. to the bottom of the form.
This, on the face of it, would seem like a simple thing to accomplish. I can return a row number from a click event by using Me. CurrentRecord but I can't assign this to my row counter text box at runtime.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
One gotcha with this:
=DSum( [Field1] , Table1 , [Table1].[id]<=[Forms]![Fo rm1]![id] )
it could be painfully slow with a lot of records and ... if there are any gaps in the auto number, you may not get sequential numbers.
mx
=DSum( [Field1] , Table1 , [Table1].[id]<=[Forms]![Fo
it could be painfully slow with a lot of records and ... if there are any gaps in the auto number, you may not get sequential numbers.
mx
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
further....
you will have to set glbRowCount = 0 prior to running the query (unless you just started Access mdb).
This could be done from within a sub
Sub StartForm()
glbRowCount = 0
docmd.openform "yourform"
end sub
Scott C
Scott C
you will have to set glbRowCount = 0 prior to running the query (unless you just started Access mdb).
This could be done from within a sub
Sub StartForm()
glbRowCount = 0
docmd.openform "yourform"
end sub
Scott C
Scott C
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Mike