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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Multiple AddDefaultValue on CrRpt

Status
Not open for further replies.

rgb30b

Technical User
May 9, 2003
19
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top