# Crystal Reports..



## smartali89 (Jan 12, 2009)

I am trying to set formula field value from another formula but it gives me error that a statement is expected:

I am using Basic Syntax..


```
Dim balance as number
dim lastBal as number

balance = 0
lastBal = {@balCalculator}

if CDbl({tblLedger.Debit}) <> 0 then 
    balance = {tblLedger.Debit} 
else 
    balance = ({tblLedger.Credit} * -1)
end if

lastBal = (lastBal + balance)

[B]{@balCalculator} = lastBal[/B]

formula = {@balCalculator}
```


----------

