Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime error 20515 when running report

Status
Not open for further replies.

stevespreyer

Programmer
Mar 18, 2005
1
NL
I have a crystal Report V8 report that has a field containing the following formula

If {@SelectCriteria2} = '' Then
'For booking period ' & {@SelectCriteria3}
Else
'For booking period ' & {@SelectCriteria3} & ' received on ' & {@SelectCriteria2}

selectcriteria1 =
select UpperCase(TRIM({?Range}))
case 'SINGLEDAY' : {?PeriodDate}
default: ToDay

selectcriteria2 =
Select {?Range}
Case 'ALL' : ''
Default : Totext({@SelectCriteria1}, 'dd-MMM-yy')

and selectcriteria3 =
StringVar SelectCriteria3;
Local numberVar dd := 1;
Local numberVar mm := Month({@SelectCriteria1});
Local numberVar yy := Year({@SelectCriteria1});

If UpperCase(Trim({?BookPeriod})) <> 'DEFAULT' Then mm := Month(Cdate('01-' & {?BookPeriod} & '-00'));
If mm > Month({@SelectCriteria1}) Then yy := yy -1;
SelectCriteria3 := UpperCase(Totext(CDate(yy,mm,dd), 'MMM-yy'));

When I run this from within Crystal reports it works fine but if I try to run it from Visual Basic 6 I get run-time error 20515 "the remaining text does not appear to be part of the formula. Can anyone tell me why please?

I'm not 100% sure how I should pass the parameters from VB anyone help with this too please?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top