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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Formulae from VB to Crystal

Status
Not open for further replies.

Theadmans

Programmer
Oct 23, 2006
35
GB
I have a VB6.0 application which runs some Crystal 8.0 Reports.

I have setup a Formula in my Crystal Report called DateRange.

In my VB code I am trying to now setup this formula as a String Variable (DateRangeVar) which I have already setup. Here is the line of code I am using:-

MyReport.FormulaFields(GetFormulaIndex(MyReport, "DateRange")).Text = DateRangeVar

However, when I run this I get the error Crystal Report Viewer "The Remaining text does not appear to be part of the formula".

If I use exactly the same syntax to setup up a formula with a Table Field instead this works fine. Can anyone see what I am doing trying to setup a Formula as a String?
 
I have solved this now - need to use syntax like:-

DateRangeVar = "'01 January 2006 - 31 July 2006'"

I did need realise the need for the double quotes followed by the single quotes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top