Results 1 to 12 of 12

Thread: Data Reports Breaking

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2007
    Posts
    307

    Data Reports Breaking

    Very new to VB6 and here is what i am trying to achieve.

    I am making a report with the data reports tool.

    Here is some code
    VB Code:
    1. Private Sub cmdshow_Click()
    2. 'Create a RS
    3. Dim RS2 As ADODB.Recordset
    4. Set RS2 = New ADODB.Recordset
    5.  
    6. 'Create a basic Sql string
    7. Dim strSQL As String
    8. strSQL = "SELECT * FROM msds where lastmodified > '2007-01-18' order by companyname"
    9.  
    10. 'Open the Recordset
    11. RS2.Open strSQL, "driver={MySQL ODBC 3.51 Driver};database=msds;Option=3;server=" & PathMySQL & ";uid=;pwd=;"
    12.  
    13. 'Bind to the report
    14. Set DataReport2.DataSource = RS2
    15.  
    16. 'Preview the report
    17. DataReport2.Show vbModal
    18.  
    19. 'Cleanup
    20. RS2.Close
    21. Set RS2 = Nothing
    I want to break when the company name changes.
    For example sample data

    COMPANYA CHEMICALA
    COMPANYA CHEMICALB
    COMPANYB CHEMICALA

    I would want
    COMPANYA CHEMICALA
    COMPANYA CHEMICALB

    And when i am done listing chemicals for that company start a new page
    COMPANYB CHEMICALA

    Hopefully i am clear enough. Thanks!!
    Last edited by Hack; Jan 30th, 2007 at 12:19 PM. Reason: Added [vbcode] [/vbcode] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width