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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating individual filenames when exporting report to HTML

Status
Not open for further replies.

louchem

Technical User
Jun 17, 2003
2
US
Newbie here...so be gentle. :)

I have a problem that seems like it should be simple, but I am stumped. I've checked the FAQ and searched around but have yet to find a solution.

I have a report that I want to export to HTML. I want each record to be exported to it's own HTML file. I've been able to get this to work by using the &quot;Force New Page&quot; selection and the Export function. But what I get are filenames like <name of report>Page1.html, name of report>Page2.html, name of report>Page3.html, etc. I want to have each HTML file named using the Name value in each record. So, I want the filenames to look like this johnsmith.html, adamjones.html, stevesmith.html, etc.

So, I explored the OutputTo function in VBA and tried this code based upon various helpfiles:

DoCmd.OutputTo acOutputReport, &quot;<reportname>&quot;, acFormatHTML, &quot;c:\&quot; & Reports!<reportname>!Name.Text & &quot;.html&quot;

It got me almost where I wanted to be. The output it gave me used the name from the first record and appended Page1, Page2, etc...so I got johnsmithPage1.html, johnsmithPage2.html, etc.

But, I don't know where to go from here. I'm a complete novice using VBA, so I hoping I'm just missing some simple command or designation.

Any help would be appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top