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!

Passing a string from VB6 into Crystal Reports

Status
Not open for further replies.

jasonthorpe

Programmer
Feb 15, 2001
2
GB
Hi,

I am trying to pass a text string based on the type of report selected. How do I setup a field on my report so that I can pass data into it and also what is the code to pass it from VB6. I have tried using formulas in the report but I can't get it to work. Please Help
 
You probably want to create a string formula and then overwrite the contents of that formula with your VB string variable.

Which technique are you using to launch the report? If you aren't sure, post the line of VB code that launches the report and that usually will be enough to identify it. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thanks for your help,

I run the report using the command below.

crReport1.Action = 1

What formula should I use in my field and how do I overwrite it in VB? I have tried using the info in the help file but I kept getting formula not found errors.?
 
You are using the ActiveX control, so the line of code should be:

Report.formulas(0) = "MyFormula = mystringvariable"

Post the line of code that you tried and I will see what the problem is. One common problem is that you don't give it the "@" sign when you name the formula before the equal sign. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top