Hi,
I have data in an access database that I wish to output in a VB6 report
depending on certaine dates (if a record data_field is not in the range, it
should be excluded)
Imanaged to do that by writing the code (see below) by hand (or using a stored procedure).
However, I also want to use the grouping feature of VB6 which I cannot get
to work with the above code as only detail section accepts information.
Is there a way to get both to work ?VB Code:
Private Sub mnureport_Click() Dim cn As Connection Dim rs As Recordset Dim dv1 As Variant Dim dv2 As Variant Set cn = New Connection cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\Desktop\TobaccoCardPerso\TCP.mdb;Persist Security Info=False" dv1 = DateValue("05/10/2003") dv2 = DateValue("05/20/2006") Set rs = cn.Execute("SELECT * from TCP WHERE Date BETWEEN #" & dv1 & "# AND #" & dv2 & "# ORDER By last_name") Set DataReport1.DataSource = rs DataReport1.Show End Sub
Regards,
Philipe
Edit: Added [vbcode][/vbcode] tags for clairty. - Hack




Reply With Quote