Hi Andy,
I could not duplicate your code in a test app because I do not know what
'crystalcountsheets' is.
Let's see if I can help another way. Here's how I pass parameters to a
crystal report through vb .net:
Dim paramFields As New ParameterFields
Dim paramField As New ParameterField
Dim paramField2 As New ParameterField
Case "f:\imcapps\histdeff.rpt"
paramField.ParameterFieldName = "pstartbox" ' the name of one parameter in
the report
paramField2.ParameterFieldName = "pendbox" ' the name of one parameter in
the report
discreteVal.Value = Me.mmcomment1
discreteVal2.Value = Me.mmcomment2
paramField.CurrentValues.Add(discreteVal)
paramField2.CurrentValues.Add(discreteVal2)
paramFields.Add(paramField)
paramFields.Add(paramField2)
CrystalReportViewer1.ParameterFieldInfo = paramFields
connectionchange()
I first assign the two parameter names in the report to a parameterfield
variable. I then assign values to discreteval and discreteval2. I then
make those the currentvalues of the parameter variables; then they are added
to the parameterfields collection; finally, I add the parameterfields
collection to the viewer's parameterfieldinfo. Connectionchange() simply
changes pwds, logins, etc and run the report document object.
HTH,
Bernie