stevespreyer
Programmer
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?
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?