How to do "group by" in a vba loop

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I have a recordset based on a query and I need to build an Excel report with
it. I can loop thru the recordset and populate the data into the Excel
worksheet. But what I can't do is "group by" one of the field in the query
and put it as a sub-heading and put the details below it. For example I have
a field called Purchase Order Number, I like to group by the PO # as
sub-heading and put the order details under it. The query could return
multiple PO #'s. My question is how to do Group By in a vba loop. Thanks.
 
I mean how to do it like Access report, you can group by using one of the
field as a section header and then put the details in the section.
 
Back
Top