Exporting Query Results to HTML - Tag Bloat

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

Paul Proefrock

I have a query that produces membership information, used for posting on the
internet. If we run the query to export as HTML, the output is loaded with
HTML tags, that really aren't necessary. I can cut the file size by 75% by
removing these tags.

Removing the tags is presently being done manually. Is there a way to
control the tags that Access puts into an exported HTML file or perhaps code
that will do a similar thing.

Thanks

Paul
(I posed this question about two years ago and received a comment but I
can't find the reply and Google has also been unsuccessful - can't find the
correct combination of search words)
 
Hi Paul,

There's no way to control how Access does it. I feel that the best
approach, if you want full control or lean HTML, is to do it yourself.

Modify the query to include calculated fields so each record it produces
is a row of your HTML table. For instance, the first field might be
F1: "<tr><td>" & [Field1] & "</td>"
and the last field
F5: "<td>" & [Field5] & "</td></tr>"

Then have your code export it to a space-delimited text file.

Next, write to another text file whatever you need before the table,
starting with the opening <html> tag and continuing to the <table> tag
that opens the table. Concatenate the two files. Finally, append the
rest of the page (at a minimum, this would be just
</table>
</body>
</html>
).
 
There is at least one reply with a function in the modules NG where you
asked the same question. I assume you just messed up a bit when you didn't
include "queries" in you cross-post.

--
Duane Hookom
MS Access MVP
--

John Nurick said:
Hi Paul,

There's no way to control how Access does it. I feel that the best
approach, if you want full control or lean HTML, is to do it yourself.

Modify the query to include calculated fields so each record it produces
is a row of your HTML table. For instance, the first field might be
F1: "<tr><td>" & [Field1] & "</td>"
and the last field
F5: "<td>" & [Field5] & "</td></tr>"

Then have your code export it to a space-delimited text file.

Next, write to another text file whatever you need before the table,
starting with the opening <html> tag and continuing to the <table> tag
that opens the table. Concatenate the two files. Finally, append the
rest of the page (at a minimum, this would be just
</table>
</body>
</html>
).

I have a query that produces membership information, used for posting on
the
internet. If we run the query to export as HTML, the output is loaded with
HTML tags, that really aren't necessary. I can cut the file size by 75% by
removing these tags.

Removing the tags is presently being done manually. Is there a way to
control the tags that Access puts into an exported HTML file or perhaps
code
that will do a similar thing.

Thanks

Paul
(I posed this question about two years ago and received a comment but I
can't find the reply and Google has also been unsuccessful - can't find
the
correct combination of search words)
 
Back
Top