How to Use Variables In Report Title With CRP9.02

10-19-2004, 07:04 AM

I’m using CRP 9.02 to create reports in my program. I want to use a variable in my program such as "strCustomer_name" and send it to each report for using in report title. I declare a Parameters in report and named it cuname1 and then in the program I use this code:

1: Dim rpt2 As New crpReminderReport
2: rpt2.cuname1.Value = strCustomer_name
3: rpt2.Database.SetDataSource rstReport
4: rpt2.PrintOut True

When I run the program I get this error message on line 2: “Error 424: Object required”

How can I use this method to put my customer name on title of my reports?

Thank you

10-19-2004, 05:34 PM
What is "cuname1" defined as? What is strCustomer_name defined as? Is this a string you are passing. If cuname1 is a parameter, you should loop all parameters in the parameters collection and do a select case on the parameter field name. Then, give each unique parameter a new value via the .SetCurrentValue method.

10-19-2004, 11:11 PM
I've changed line 2 into this:
rpt2.ParameterFields(1).AddCurrentValue strCustomer_name
and it works!
Thank you very much, you do a great job!

10-20-2004, 05:26 PM
Your welcome, and thanks for the compliment. Good luck with your application.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum