Unbound text box as counter

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.
 
M

Michel Walsh

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top