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

Easy HTML Templating?

Status
Not open for further replies.

perrymans

IS-IT--Management
Nov 27, 2001
1,340
US
I am working with MS Access and I want to be able to send my reports via email, but they just look like crap in .rtf and .html. HTML is the only extension which Access allows templating to be used.

I would like to create a template of what my report actually looks like so that it can be just filled in and it will look exactly the same as the original report. I know even less about html than I do anything else. I tried the to edit a saved html report in Word but that was a complete failure.

Please help. Sean.
 
Hi Sean

Your question is more of an Access question then a HTML question. Fortunately I have more skill with Access then HTML and I saw your question.

Here's a template that I created for a customer:
Code:
<HTML>
<HEAD>
<META HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html;charset=windows-1252&quot;>
<TITLE>Motor Details Report</TITLE>
</HEAD>
<BODY bgcolor=&quot;#C0C0C0&quot;>
<p><img border=&quot;0&quot; src=&quot;C:\header.jpg&quot; width=&quot;750&quot; height=&quot;66&quot;>
<!--ACCESSTEMPLATE_BODY--></p>
<br>
Page#:<!--ACCESSTEMPLATE_PageNumber-->
<p><strong>Any questions or concerns contact</strong><a href=&quot;mailto:someone@domain.ca&quot;>someone</a></p>
</body>
<hr>
<A HREF=<!--ACCESSTEMPLATE_FirstPage-->>[First]</A>
<A HREF=<!--ACCESSTEMPLATE_PreviousPage-->>[Previous]</A>
<A HREF=<!--ACCESSTEMPLATE_NextPage-->>[Next]</A>
<A HREF=<!--ACCESSTEMPLATE_LastPage-->>[Last]</A>
<hr>
</html>

The important thing to remenber is that Access uses the <!--AccessTEMPLATE_***--> as a place mark for its report info and hence regular html can fill in the rest.

The way I used the template was to use the SendOBject of the DoCmd object and the last parameter is the path to my template as:

DoCmd.SendObject acSendReport, &quot;rptSummary&quot;, acFormatHTML, , , , &quot;Summary Report&quot;, &quot;Enclosed is the Summary Report&quot;,,&quot;c:\template.html&quot;

Hope this helps,
Rewdee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top