P
Philippe C. Martin
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)
I only managed to do that by writing the code by hand:
************************************
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
************************************
However, I also want to use the grouping feature of VB6 which I cannot get
to work with the abot code.
Is there a way to get both to work ?
Regards,
Philipe
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)
I only managed to do that by writing the code by hand:
************************************
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
************************************
However, I also want to use the grouping feature of VB6 which I cannot get
to work with the abot code.
Is there a way to get both to work ?
Regards,
Philipe