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 codeI want to break when the company name changes.VB Code:
Private Sub cmdshow_Click() 'Create a RS Dim RS2 As ADODB.Recordset Set RS2 = New ADODB.Recordset 'Create a basic Sql string Dim strSQL As String strSQL = "SELECT * FROM msds where lastmodified > '2007-01-18' order by companyname" 'Open the Recordset RS2.Open strSQL, "driver={MySQL ODBC 3.51 Driver};database=msds;Option=3;server=" & PathMySQL & ";uid=;pwd=;" 'Bind to the report Set DataReport2.DataSource = RS2 'Preview the report DataReport2.Show vbModal 'Cleanup RS2.Close Set RS2 = Nothing
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!!




Reply With Quote