Fetch Balance from last entry

Fetch Balance from last entry

Hello,

      I have a simple accounting form with the following fields:

Date
Previous Balance
Current Balance
Amount Change
Percent Change
Row1

     When I go to enter a new record, I want the Previous Balance field to be automatically populated with the previous entry's Current Balance..

This is the formula I tried in the "On Load" section, and it seems close:

Current_Balance = 0;
for each row1 in MGMT [ID != 0]
{
Current_Balance = row1.Previous_Balance;
}


     Any help would be greatly appreciated.

Thanks

Nick