Unbound text box as counter

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I have a subform for data entry, I have a column in the
subform that needs to be counter. It cannot be the auto
number field. I want the number in this column to equal
the dao recordset counter. As in if the record is 16 of
457 as shown on the subform dao counter I want the entry
for that row in this column to be 16. I rather not
connect to the database through dao or ado vb code due to
fact that this would bog the network down.

Any help very appreciated. thatnkyou.
 
Hi,

That number belong to a recordset, it is not present in the table.
Indeed, open the recordset with another WHERE clause, or with a different
ORDER BY, and you will get another "position" for the records still
retrieved. Since the number belong to a recordset, it is the method
AbsolutePosition, you have to either to play some trick in the
onCurrentEvent, either "compute" that number, counting the number of records
that are before the actual one, using a computed expression like:

DCount("*", "tablenameHere", "orderingField<=" & orderingField)

in the query on which you will base your form.

I think Stephen has something on his site too, about that subject. You may
check at http://www.lebans.com/


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top