using SQL + grouping in VB6 report

  • Thread starter Philippe C. Martin
  • Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top