Access a Record two times in a for-each-statement

storzi

Member
Hi,

I have the following for-each-statement:
Code:
FOR EACH Table WHERE Table.Firma = 1
                       AND   Table.status < 9:
...
    Table.status = 1. /* Table.status was: 0 */
...
END.

Under special circumstance I set the Table.status from 0 to 1 in this loop.
When I do so, the same record is in Access again in the next flow of
the loop.

Can I do anything, to avoid this?

Thanks.
 
Hi, you can add for example a breaj by table.firma on your for each. It isn't very "clean" but it works. I think that is because the whole for each is keep in memory and new record aren't take in account.
A second solution is to use do preselect each table... : get-next... end. It's more "elegant" but need more transformation of the ancient code.

Regards.

Stéphane.

Hi,

I have the following for-each-statement:
Code:
FOR EACH Table WHERE Table.Firma = 1
                       AND   Table.status < 9:
...
    Table.status = 1. /* Table.status was: 0 */
...
END.

Under special circumstance I set the Table.status from 0 to 1 in this loop.
When I do so, the same record is in Access again in the next flow of
the loop.

Can I do anything, to avoid this?

Thanks.
 
Back
Top