Thanks for having a look at my problem.
CR 8.5
VB 6
I am trying to display multiple values derived from a recordset loop to show on my report. I can see the different values being shown in VB, but it returns no data as a parameter to the report, eg; If I select info from the MachineOrder datacombo dropdown it will populate the parameter {?MachineOrder} in the report. When I do this it works fine. My goal is to pass "all" data from the recordset if nothing is selected from the combobox. I do not get any errors in VB. The datatype is String in VB and String in CR. Any suggestions would be appreciated.
If MachineOrder <> "" Then
crRpt.ParameterFields.GetItemByName("MachineOrder").AddCurrentValue CStr(MachineOrder)
Else
Set Para = crRpt.ParameterFields(6)
For i = Para.NumberOfDefaultValues To 1 Step -1
Para.DeleteNthDefaultValue i
Next
cn.Open ConnectionString
sql = "Select MachineNum, Sku from HeldProduct"
sql1 = "Select Distinct MachineNum from HeldProduct"
rs.Open sql, cn, adOpenKeyset
rs1.Open sql1, cn, adOpenKeyset
While rs.EOF = False
crRpt.Database.SetDataSource rs
rs.MoveNext
Wend
While rs1.EOF = False
'On Error Resume Next
Para.AddDefaultValue rs1.Fields(0).Value
rs1.MoveNext
Wend
End If
CR 8.5
VB 6
I am trying to display multiple values derived from a recordset loop to show on my report. I can see the different values being shown in VB, but it returns no data as a parameter to the report, eg; If I select info from the MachineOrder datacombo dropdown it will populate the parameter {?MachineOrder} in the report. When I do this it works fine. My goal is to pass "all" data from the recordset if nothing is selected from the combobox. I do not get any errors in VB. The datatype is String in VB and String in CR. Any suggestions would be appreciated.
If MachineOrder <> "" Then
crRpt.ParameterFields.GetItemByName("MachineOrder").AddCurrentValue CStr(MachineOrder)
Else
Set Para = crRpt.ParameterFields(6)
For i = Para.NumberOfDefaultValues To 1 Step -1
Para.DeleteNthDefaultValue i
Next
cn.Open ConnectionString
sql = "Select MachineNum, Sku from HeldProduct"
sql1 = "Select Distinct MachineNum from HeldProduct"
rs.Open sql, cn, adOpenKeyset
rs1.Open sql1, cn, adOpenKeyset
While rs.EOF = False
crRpt.Database.SetDataSource rs
rs.MoveNext
Wend
While rs1.EOF = False
'On Error Resume Next
Para.AddDefaultValue rs1.Fields(0).Value
rs1.MoveNext
Wend
End If