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

Passing a VB Variable

Status
Not open for further replies.

tsdp

Programmer
Jul 17, 2001
6
US
I'm using cr 8.5 and vb6.0, in previous versions of crystal I didn't have any problem passing in a date. I set-up a formula with just a string value then replaced it at run-time using this code:
cryPerformanceCumulative.Formulas(0) = "StartDate = '" & txtStartDt & "'"

This does not seem to work in crystal 8.5, I have looked at the devhlp files and have tried there example with no luck.
report.FormulaFields.Item(1).Text = strTodt

I do not get any errors but it will not replace the string value.

Any suggestions?

Thanks
 
Changing version doesn't change the syntax, but changing the integration method does.

Did you change integration methods? It looks like you are now using the RDC (and weren't before). Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
I'm not using RDC in either, but I did figure out a way around my problem. When I replace the string value in my formula I was replacing everything.
ex: "xxxx" would be the dummy string in my formula.
I would replace it with a valid string but would only get the xxxx and not the ("") quotes. So in turn Crystal would bomb because of an invalid string. So to fix that I now pass everything.
chr(34) & variable & chr(34) works like a champ.

Thanks for responding. Would love to get you down to central florida for some training.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top