Image courtesy of ddpavumba at FreeDigitalPhotos.net

Microsoft Access allows you to export data from any of it’s 4 main objects (tables, queries, forms & reports) as HTML — another example of the advantages of Microsoft Office applications’ interoperability.

As the data is tabulated Access outputs HTML webpages with fairly rudimentary tables displaying the data. Below is an excerpt of such HTML:

<TABLE BORDER=1 BGCOLOR=#ffffff CELLSPACING=0><FONT FACE="Calibri" COLOR=#000000><CAPTION><B>frmLyrics</B></CAPTION></FONT>
<THEAD>
<TR>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:11pt FACE="Calibri" COLOR=#000000>TrackID</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:11pt FACE="Calibri" COLOR=#000000>TrackName</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:11pt FACE="Calibri" COLOR=#000000>TrackLyrics</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:11pt FACE="Calibri" COLOR=#000000>TrackArtistName</FONT></TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN=TOP>
<TD BORDERCOLOR=#a6a6a6  ALIGN=RIGHT><FONT style=FONT-SIZE:11pt FACE="Calibri" COLOR=#000000>4964</FONT></TD>
<TD BORDERCOLOR=#a6a6a6 ><FONT style=FONT-SIZE:11pt FACE="Calibri" COLOR=#000000>Don't Worry Be Happy</FONT></TD>
<TD BORDERCOLOR=#a6a6a6 ><FONT style=FONT-SIZE:11pt FACE="Calibri" COLOR=#000000>Here's a little song I wrote<BR>You might want to sing it note for note<BR>Don't worry, be happy<BR>In every life we have some trouble<BR>But when you worry you make it double<BR>Don't worry, be happy<BR>Don't worry, be happy now</FONT></TD>
<TD BORDERCOLOR=#a6a6a6 ><FONT style=FONT-SIZE:11pt FACE="Calibri" COLOR=#000000>Bobby McFerrin</FONT></TD>
</TR>
</TBODY>
</TABLE>

The HTML produced is very old-fashioned. Opening the HTML files and editing them in Notepad++ is simple enough.

You will encounter some random errors, such as the bordercolor attribute being applied to the <tr> instead of the <table> tag and the incorrect nesting of the <font> tags outside the <caption> tags.

Some quick fixes using the Replace (CTRL+H) feature in Notepad++:

  • All HTML tags and attributes are in upper case
  • The attribute values are not in inverted commas
  • There are some weird “attributes” that are not strictly HTML
<table border="1" bordercolor="#a6a6a6" bgcolor="#ffffff" cellspacing="0">
	<caption><font face="Calibri" color="#000000"><b>frmLyrics</b></font></caption>
	<thead>
		<tr>
			<th bgcolor="#c0c0c0"><font style="font-size: 11pt" face="Calibri" color="#000000">TrackID</font></th>
			<th bgcolor="#c0c0c0"><font style="font-size: 11pt" face="Calibri" color="#000000">TrackName</font></th>
			<th bgcolor="#c0c0c0"><font style="font-size: 11pt" face="Calibri" color="#000000">TrackLyrics</font></th>
			<th bgcolor="#c0c0c0"><font style="font-size: 11pt" face="Calibri" color="#000000">TrackArtistName</font></th>
		</tr>
	</thead>
	<tbody>
		<tr valign="top">
			<td align="right"><font style="font-size: 11pt" face="Calibri" color="#000000">4964</font></td>
			<td><font style="font-size: 11pt" face="Calibri" color="#000000">Don't Worry Be Happy</font></td>
			<td><font style="font-size: 11pt" face="Calibri" color="#000000">Here's a little song I wrote<br />
				You might want to sing it note for note<br />
				Don't worry, be happy<br />
				In every life we have some trouble<br />
				But when you worry you make it double<br />
				Don't worry, be happy<br />
				Don't worry, be happy now</font></td>
			<td><font style="font-size: 11pt" face="Calibri" color="#000000">Bobby McFerrin</font></td>
		</tr>
	</tbody>
</table>

When you export a multi-page report, Access outputs multiple linked HTML pages — one for each page of the report which is very handy.

By MisterFoxOnline

CAT Educator

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.