Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to export report to a csv file

Status
Not open for further replies.

ceej

IS-IT--Management
Jun 20, 2001
46
US
Either this is an easy question or really hard.

I have a report which has a group header, detail, & group footer. I need to export the report to a csv file.

I can't export a query because of the group header, detail & footer sections. The columns of each section are different.

What are my options?

Much thanks,

CJ



 
I don't know about exporting the report as a CSV but you can export data as a CSV.

If you're using ADO take a look at GetString()

This is a snippet

Code:
[COLOR=green]'ExportPath is a string holding the path for the output file [/color]
    Open ExportPath For Append As #1
    Do While Not rs.eof
        Print #1, rs.GetString(, , ",", vbCrLf, "");
   
    Loop
    Close #1
    Set rs = Nothing
 
I do not think that CSV will be very useful in the situation you describe. Have a look at DoCmd.OutputTo.
 
Thank you for the advice.

The text file would be somthing like this:

group header line
detail line
detail line
group summary line
group header line
detail line
detail line
detail line
group summary line

I'll let you know what I come up with.

Thanks,

CJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top