Replace balance With 0 Alland after then
Replace balance With blnc &&& where blnc = blnc+debit-creditand
Set Filter To code=thisform.code.value &&& is in actionMay be you want
update AccTran; set Balance = blnc+debit-credit; where Code = ThisForm.Code.Value>these code can be changes into sql
>Select accounts > Locate For code=thisform.code.value > opbl = opdr-opcr > Select acctran > Set Order To date > Set Filter To > Set Filter To code=thisform.code.value > Goto Top > Replace balance With 0 All > Goto Top > blnc = opbl > Do While !Eof() > blnc = blnc+debit-credit > Replace balance With blnc > Skip > Enddo >