I am struct with one report. I use a number of recordsets to meet requirements of my report. It works fine but the problem is:
It displays only first record; I need to have all records. I don't know how I can do that. Here is partial code of my DataReport in VB6
For Each sect In RptDailyClosingSummarytrial.Sections
Expand|Select|Wrap|Line Numbers
- Debug.Print "Section", sect.Name
- For Each ctl In sect.Controls
- 'for different status of emplyes
- If ctl.Name = "dates" Then
- ctl.Caption = strdates
- End If
- If ctl.Name = "lblName" Then
- ctl.Caption = RS.Fields!company_name
- End If
- If ctl.Name = "lblAddress" Then
- ctl.Caption = RS.Fields!address
- End If
- If ctl.Name = "lblCity" Then
- If IsNull(RS.Fields!city) Then
- ctl.Caption = ""
- Else
- ctl.Caption = RS.Fields!city
- End If
- End If
- If ctl.Name = "lblPostalCode" Then
- If IsNull(RS.Fields!postal_code) Then
- ctl.Caption = ""
- Else
- ctl.Caption = RS.Fields!postal_code
- End If
- End If
- If ctl.Name = "lblProvince" Then
- If IsNull(RS.Fields!province) Then
- ctl.Caption = ""
- Else
- ctl.Caption = RS.Fields!province
- End If
- End If
- If ctl.Name = "lblPhoneNo" Then
- If IsNull(RS.Fields!phone_number) Then
- ctl.Caption = ""
- Else
- ctl.Caption = RS.Fields!phone_number
- End If
- End If
- '''''''''''''''''Record count''''''''''''''
- If ctl.Name = "counts" Then
- If IsNull(PS.Fields!Con) Then
- ctl.Caption = "0.0"
- Else
- ctl.Caption = PS.Fields!Con
- End If
- End If
- ''''''''''txtgroup_id'''''''''''''''
- If ctl.Name = "txtGroup_ID" Then
- ctl.Caption = oRS.Fields!group_id
- End If
- ''''''''''''''''''txtname'''''''''
- If ctl.Name = "txtName" Then
- ctl.Caption = oRS.Fields!Name
- End If
- ''''''''''''''''''txtPrice1''''''''
- If ctl.Name = "txtPrice1" Then
- ctl.Caption = oRS.Fields!price1
- End If
- ''''''''''''''''''txtgst1''''''''
- If ctl.Name = "txtgst1" Then
- ctl.Caption = NS.Fields!gst1
- End If
- ''''''''''subtotal'''''''''''''''
- If ctl.Name = "subtotal" Then
- If IsNull(PS.Fields!sum1) Then
- ctl.Caption = "0.00"
- Else
- ctl.Caption = Format(PS.Fields!sum1, "########0.00")
- End If
- End If
- '''''''''''''''gst'''''''''''''''
- If ctl.Name = "gst" Then
- If IsNull(PS.Fields!sum2) Then
- ctl.Caption = "0.00"
- Else
- ctl.Caption = Format(PS.Fields!sum2, "########0.00")
- End If
- End If
- '''''''''''''''''grand total''''''
- If ctl.Name = "grandtotal" Then
- If IsNull(PS.Fields!sum3) Then
- ctl.Caption = "0.00"
- Else
- ctl.Caption = Format(PS.Fields!sum3, "########0.00")
- End If
- End If
- '''''''''''''''Average'''''''''''''
- If ctl.Name = "average" Then
- If IsNull(PS.Fields!net) Then
- ctl.Caption = "0.00"
- Else
- ctl.Caption = Format(PS.Fields!net, "########0.00")
- End If
- End If
- ''''''''''''''''''''''''''''''''''''
- '''''''''''''''Cash Transections'''''''''''''
- If ctl.Name = "lblCashTran" Then
- If IsNull(GS.Fields!sum3) Then
- ctl.Caption = "0.00"
- Else
- ctl.Caption = Format(GS.Fields!sum3, "########0.00")
- End If
- End If
- ''''''''''''''''''''''''''''''''''''
- '''''''''''''''Account Transections'''''''''''''
- If ctl.Name = "lblChqOut" Then
- If (MS.RecordCount = 0) Then
- ctl.Caption = "0.00"
- Else
- ctl.Caption = Format(MS.Fields!sum3, "########0.00")
- End If
- End If
- ''''''''''''''''''''''''''''''''''''
- ' oRS.MoveNext
- Next ctl
- Next sect
thanks in advance
Regards