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 multiple parameters to CR via VB App

Status
Not open for further replies.

ter79

IS-IT--Management
Jul 11, 2001
106
US
I'm trying to pass two (2) parameters to a CR from a VB app. I keep getting an error message stating "Error 20553(invalid parameter field value)"

I have included the code that I am using.

Any and all assistance is greatly appreciated.


cr.Destination = 0
Screen.MousePointer = vbHourglass
Me.Enabled = False
cr.WindowShowCancelBtn = False
B = Format$(Text1, "yyyy,mm,dd")
D = Format$(Text2, "yyyy,mm,dd")
cr.ParameterFields(i) = "BeginDate;Date(" & B & ");True"
i = i + 1
cr.ParameterFields(i) = "EnDate;Date(" & D & ");True"
cr.Action = 1
 
What does "D" look like at that point. My guess is that it isn't in Crystal syntax. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
D is a second date. When I hover over the line in step by step mode in VB, it show the correct format, however as soon as I go to the next step it erases the first parameter.

I tested the code by sending the first paramater only and it works, since CR prompts me for the second parameter field.
 
Are you sure that the parameter name is spelled correctly, like should it be EndDate instead of EnDate? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
The spelling is correct, a mistake on my part during the creation of the parameter name.
 
If both parameter fields are the type "Date" then you need to do some troubleshooting testing. First I would hard code the i value for each parameter, then test them both separaterly, then I would hard code the value, then try reversing the order. One of these may tell you something. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top