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 Parameters to CR via VB

Status
Not open for further replies.

ter79

IS-IT--Management
Jul 11, 2001
106
US
I am trying to send parameters to CR from VB.

cr.ReportFileName = App.Path & "\credittally.rpt"
i = 0
cr.ParameterFields(i) = "b;Date(" & Format(sdate, "yyyy,mm,dd") & ");True"
i = i + 1
cr.ParameterFields(i) = "e;Date(" & Format(EDate, "yyyy,mm,dd") & ");True"
cr.Action = 1

However, I keep getting the parameter prompt box when I run the code for the report.

Any ideas on what I am doing wrong or any suggestions?
 
- Make sure that "b" and "e" are the names of your parameters in the Crystal report and they are defined as Date.

- Then I used to do this in VB:

Dim strDate as string

strDate = "Date(" & Year(txtDateFieldinVB.text) & "," & Month(txtDateFieldinVB.text) & "," & Day(txtDateFieldinVB.text) & ")"
CrystalReport1.ParameterFields(0) = "p1;" & strDate & ";true"
CrystalReport1.Action = 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top