A: 

You could try the current event of the form, as suggested previously :)

Remou
it runs fine and numbers are displayed using either event ... the problem is that Me.Key is always the same value if it's run like this whereas in the form itself it's different per row. some rookie error i'm making i feel!
Ben Roberts
You talk of rows, this suggests that you are using a continuous form or datasheet, if this is the case, you will need to look at a different approach, such as setting up a query, or changing to a single form.
Remou
using a continuous form so guess i'll need to do something different, i can't use the single form approach as this form is built as a sort of navigator for the users - each row displays aggregate financial information that can be drilled down into multiple times to see (eventually) individual incomes with their dates that the charity received per project/donor/income stream. Is there an access-standard way to populate data per row of the form from the database based on values in that row?
Ben Roberts
I think you may need a suitable query, because the problem with continuous forms is that only bound controls will display different data for each row. Perhaps you could provide the schema for the tables from which data is to be displayed?
Remou
thankyou for all your answers on this ... by the time this query is run there are about 8 database tables, maybe 30 different columns being used so rather than spam all of that i think i'll take a good look at re-working the RecordSource query for the form to include months.
Ben Roberts
A: 

I guess the Me.Key refers to a control located in the details section of your form. In this case, and in order to list all values taken by the control, you will need to browse all the records. One of the ways to do so can be:

Dim m_position as Long
for m_position = 1 to Me.recordset.recordcount
   me.seltop = m_position
   debug.print me.key
next m_position

Unfortunately your will see your screen blincker while browsing all the lines. You can off course find some 'screenFreezer' utilities for VBA on the net (there is one called LockWindowUpdate, as long as I can remember).

Another solution is to browse the clone of the underlying recordset (browsing the recordset will provoke the same screen behaviour as before). Supposing that the Me.Key control is bound to the "Key" column of the recordset, code could be:

Dim rsClone as DAO.recordset
set rsClone = Me.recordsetclone
if rsClone.EOF and rsClone.BOF then
Else
    rsClone.moveFirst
    Do while not rsClone.EOF
        debug.print rsCLone.fields("Key")
        rsClone.moveNext
    Loop
Endif
set rsClone = nothing

My favorite is the first one, with the "freeze"option added. Your code can manage the seltop and selheight values of the form. This means you can browse specifically records selected by users and/or, once all records browsed, go back to the original record selection.

EDIT:

Following @Ben's comment, I shall add that if your "myControl" control is in the details section and is unbound, you then will not be able to manage one value per row. The control will have the same value for all lines when the form is displayed as "continuous".

If your "myControl" control is bound to the "myField" field of a recordset, any of the following codes will increment "myControl" control value and "myField" field value at the same time. You will be than able to have a different value on each row:

Solution 1:

Dim m_position as Long
for m_position = 1 to Me.recordset.recordcount
   me.seltop = m_position
   me.controls("myControl") = m_position
next m_position

Solution 2:

Dim rsClone as DAO.recordset, _
    i as long

set rsClone = Me.recordsetclone
if rsClone.EOF and rsClone.BOF then
Else
    rsClone.moveFirst
    i = 1
    Do while not rsClone.EOF
        rsClone.fields("myField") = i
        rsClone.update
        rsClone.moveNext
        i = i+1
    Loop
Endif
set rsClone = nothing
Philippe Grondier
sorry for the delay in answering, other projects got in the way. This looks like it might well help ... the blinking isn't an issue for my users (small charity i'm volunteering some time at), the system replaces hundreds of post-its, spreadsheets and emails ;)using the first solution you posted i can iterate over the different Keys and see the correct values being calculated per Key but every time Me.Oct=<x> is set every records 'Oct' field gets that same value. I've not seen SetTop before ... is there some way to use that value to set 'Oct' for just the current record?
Ben Roberts
seltop, not settop ... Please see my edit
Philippe Grondier
thanks for the write-up, i think in my specific case this won't work but as a general answer to the original question it's excellent. cheers.
Ben Roberts
A: 
Albert D. Kallal
thanks for the answer - i think this would work i it weren't for the fact that i'm displaying multiple 'keys' or multiple 'customers' in your example and i don't think i can make a continuous form have a subform.
Ben Roberts