asked on # Run time error 20515

Run Time error '20515'

Error in formula <CM_OPN_AMT>.

'IF {@OpnBal} = '0' THEN ({Temp_Clnt_PrvAmt.CMAmt}) - ({Temp_Clnt_PrvAmt.Amt_Rcvd})'

A number is required here.

Formula i am using is

IF {@OpnBal} = '0' THEN ({Temp_Clnt_PrvAmt.CMAmt}) - ({Temp_Clnt_PrvAmt.Amt_Rcvd})

Please help.

Error in formula <CM_OPN_AMT>.

'IF {@OpnBal} = '0' THEN ({Temp_Clnt_PrvAmt.CMAmt})

A number is required here.

Formula i am using is

IF {@OpnBal} = '0' THEN ({Temp_Clnt_PrvAmt.CMAmt})

Please help.

Visual Basic ClassicCrystal ReportsProgramming

Thanks

it says string required here

and cursor shows me before 0

all the fields are number

it says string required here

and cursor shows me before 0

all the fields are number

What is the OpnBal fomula?

mlmcc

mlmcc

getting OpnBal value from vb form

prvOpnBal = Val(Rs2Clnt.Fields(0)) - Val(Rs2Clnt.Fields(1))

CrystalReport1.Formulas(5) = "OpnBal = '" & prvOpnBal & "'"

prvOpnBal = Val(Rs2Clnt.Fields(0)) - Val(Rs2Clnt.Fields(1))

CrystalReport1.Formulas(5)

What is OpnBal in the report?

Since you replace it, the replacement is causing the problem

mlmcc

Since you replace it, the replacement is causing the problem

mlmcc

OpnBal is a value i wanted to show in the report.

value from database.

then i wanted to calculate this OpnBal value with "Sum of CLNT_Ledger.CMAmt"

value from database.

then i wanted to calculate this OpnBal value with "Sum of CLNT_Ledger.CMAmt"

You say the error is in this formula

IF {@OpnBal} = '0' THEN ({Temp_Clnt_PrvAmt.CMAmt}) - ({Temp_Clnt_PrvAmt.Amt_Rcvd})

Need to know if that formula is part of the report or the formula you are changing from code?

If it is not the formula you are changing then what is the original formula?

mlmcc

IF {@OpnBal} = '0' THEN ({Temp_Clnt_PrvAmt.CMAmt})

Need to know if that formula is part of the report or the formula you are changing from code?

If it is not the formula you are changing then what is the original formula?

mlmcc

as far as i tried with different different ways

now

///trying to add Sum ({CLNT_Ledger.CMAmt}, {CLNT_Ledger.conName}) in @OpnBal

formula for CM_OPN_AMT is

IF {@OpnBal} = '0' THEN Sum ({CLNT_Ledger.CMAmt}, {CLNT_Ledger.conName}) else

({@OpnBal})**+ Sum** ({CLNT_Ledger.CMAmt}, {CLNT_Ledger.conName})

it says string is required here cursor shows between + and Sum

now

///trying to add Sum ({CLNT_Ledger.CMAmt}, {CLNT_Ledger.conName}) in @OpnBal

formula for CM_OPN_AMT is

IF {@OpnBal} = '0' THEN Sum ({CLNT_Ledger.CMAmt}, {CLNT_Ledger.conName}) else

({@OpnBal})

it says string is required here cursor shows between + and Sum

View this solution by signing up for a free trial.

Members can start a 7-Day free trial and enjoy unlimited access to the platform.

Tried but

On refresh report, no error

but from code

giving me run time error 20515

Please check attached File

RUN-TIME-ERRRO-20515.doc

On refresh report, no error

but from code

giving me run time error 20515

Please check attached File

Can you upload the report and show the code you use to run it?

mlmcc

mlmcc

IF {@OpnBal} = 0 THEN ({Temp_Clnt_PrvAmt.CMAmt})

Are the other fields numbers or strings?

mlmcc