PDA

Click to See Complete Forum and Search --> : Crystal Question


EyeTalion
Sep 10th, 2004, 09:30 AM
how do you pass a parameter from VB to Crystal without the "Enter Parameter Values" box popping up?

RobDog888
Sep 10th, 2004, 11:02 PM
Use the parameters collection in the report object.
Dim crxApp As CRAXDRT.Application
Dim oReport As CRAXDRT.Report

Set crxApp = New CRAXDRT.Application
Set oReport = crxApp.OpenReport(App.Path & "\MyReport", 1)
oReport.ParameterFields.Item(1).ClearCurrentValueAndRange
oReport.ParameterFields.Item(1).AddCurrentValue CStr(oRs!Name)
'...
'...

EyeTalion
Sep 13th, 2004, 07:50 AM
thanks Rob...I was also able to use the following code:



rpt.SetParameterValue("begindate", tranPeriod)