Rao
I have some code that uses Multi-Select and I want to be able to total the Balance of the selected rows. I am using this code ( please forgive the debug info ) that loops thru the Len of aCols.
When I select multiple lines ( in this case 2 lines ) I see two bookmark records ( 141 and 288 ), however the For\Next Loop only sees the current ( last ) Bookmark 288 and loops thru twice adding up the same record twice.
Please look over this code and tell me what I am doing wrong. It appears that oLbxB:BookMark(aCols[i]) goes to the last row selected ( bookmark 288 ) and since the len of aCols = 2 .. it adds the same row twice and 80.08 gets added twice not taking into consideration bookmark 141.
Somehow, I need to be able to loop thru both bookmarks ( top to bottom ) and add the balance of the two records.
Rick Lipkin


I have some code that uses Multi-Select and I want to be able to total the Balance of the selected rows. I am using this code ( please forgive the debug info ) that loops thru the Len of aCols.
When I select multiple lines ( in this case 2 lines ) I see two bookmark records ( 141 and 288 ), however the For\Next Loop only sees the current ( last ) Bookmark 288 and loops thru twice adding up the same record twice.
Please look over this code and tell me what I am doing wrong. It appears that oLbxB:BookMark(aCols[i]) goes to the last row selected ( bookmark 288 ) and since the len of aCols = 2 .. it adds the same row twice and 80.08 gets added twice not taking into consideration bookmark 141.
Somehow, I need to be able to loop thru both bookmarks ( top to bottom ) and add the balance of the two records.
Rick Lipkin
nTotal  := 0.00
nPayment := 0.00
nBal   := 0.00
aCols   := oLbxB:aSelected
xbrowse(aCols )
msginfo( "Len aCols" )
msginfo( Len(aCols ))
For i := 1 to Len(aCols)
  msginfo( "i" )
  msginfo( i )
  oLbxB:BookMark(aCols[i])
  msginfo( "BookMark" )
  msginfo( oLbxB:BookMark(aCols[i]))
  msginfo( "Invoice Balance" )
  msginfo( oRsInvoice:Fields("Balance"):Value )
  nBal := nBal+oRsInvoice:Fields("Balance"):Value
Next
msginfo( "nBal")
msginfo( nBal )
