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

Parameter Fields from VB6

Status
Not open for further replies.

kbWilliamson

Programmer
Feb 28, 2002
18
US
Greetings:

Someone has likely had this problem before but here goes...
I have a report named rptAudit, built with Crystal 8, that I want to use parameter fields to fill in some information in the title.
At the moment there is only one Parameter field in the Report.

When I run the following code I get an "Invalid Parameter Field Name" error.
If I try to use a ".SetCurrentValue =" it causes an "Invalid Qualifier" compiler
error

Private Sub PrintIt()
Dim strLn1 As String
Dim strLn2 As String
strLn1 = "Division Name"
strLn2 = "Participant Hours and Premiums for CY " & intAudYr

With rptAudit
.ReportFileName = App.Path & "\AuditReport.rpt"
.DataFiles(0) = Mod1.pstrDataLoc
.ReportTitle = strLn1
.ParameterFields(0) = strLn2
.Action = 1
End With
End Sub

How can I set the value of the Parameter field?
 
OK... So I should have looked harder.
Found the needed code WAY down in the discussions.

In my case it is...
.ParameterFields(0) = "RTSubj;" & strLn2 & ";true"
("RTSubj" being the name of the parameter field)

Works just fine...
I can see that I'll be spending a lot of time here, great
site.

Love ya all...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top