I need some help on the SSDBGrid from Sheridan (no longer around) doing something simple and am missing something obvious. I am basically trying to get a running balance of numbers. The number for each row is in Col(10) and I want to have a running balance calculated and placed in Col(8) of that row, then move to the next. My problem in the code below is the line where I am trying to set the new value to the cell. The CellValue is a read only and their help files says to set a value you use the Value property. However, using the .Value property is not moving along with the rows as I move down, thus resulting in the Col(8) being set is always the first row, not each row as I work down.

I know I am just missing something simple. Please help

Mickey

VB Code:
  1. 'Make sure the accumulator is empty
  2. GLRunningBal = 0
  3.  
  4. LedgerGrid.Redraw = False    'Turn off so don't see movement
  5.  
  6. 'Get current bookmark & first row to be able to return to same relative position
  7. CurrentBkMark = LedgerGrid.Bookmark
  8. CurrentVisableRow = LedgerGrid.FirstRow
  9.  
  10. LedgerGrid.MoveFirst
  11. 'Cycle thru all the rows
  12. For X = 0 To LedgerGrid.Rows - 1
  13.     BkMrk = LedgerGrid.GetBookmark(X)
  14.  
  15.     'Calculate the running balance column (col(8)) which is the number in col(10) of this row
  16.     'plus what the balance is up to this point
  17.     GLRunningBal = GLRunningBal + Val(LedgerGrid.Columns(10).CellValue(BkMrk))
  18. 'Here is the problem line
  19.     LedgerGrid.Columns(8).CellValue(BkMrk) = GLRunningBal
  20.    
  21.    Next
  22.  
  23. 'Return to original row & relative position
  24. LedgerGrid.FirstRow = CurrentVisableRow
  25. LedgerGrid.Bookmark = CurrentBkMark
  26.  
  27. LedgerGrid.Redraw = True    'Turn back on