Google Answers Logo
View Question
Q: DoCmd.OutputTo in Microsoft access ( Answered 4 out of 5 stars,   1 Comment )
Subject: DoCmd.OutputTo in Microsoft access
Category: Computers > Programming
Asked by: sjw-ga
List Price: $5.00
Posted: 23 Mar 2005 22:11 PST
Expires: 22 Apr 2005 23:11 PDT
Question ID: 499535
What is the template format for DoCmd.OutputTo in Microsoft access? 

I've gotten this far but not sure what the template would be, like the
coding. I tried to make a template to enlarge the font. This is what I
DoCmd.OutputTo acOutputQuery, "Messages", acFormatHTML,
"C:\MessagesForAssociates2.html", 0, "C:\template.html"

The html code for the template is:
="24" COLOR=#000000><CAPTION><B>Messages</B></CAPTION></FONT>
But the font does not change. What am I missing?

Clarification of Question by sjw-ga on 24 Mar 2005 02:18 PST
I need the output of the query to be formatted according to the
template but I can't seem to create a template that will enlarge the
font beyond 10pt, which is what the default output is.
Subject: Re: DoCmd.OutputTo in Microsoft access
Answered By: hammer-ga on 24 Mar 2005 07:49 PST
Rated:4 out of 5 stars

Setting the font in the table tag does not affect the contents of the
table. You need to get your font tags around the text you actually
mean to affect.

	<CAPTION><B><FONT FACE="Arial" size="24"

If you want to use CSS instead of the older style Font tags, you can
use the nice example provided below by willcodeforfood-ga. Note that
the style information is in the CAPTION tag, which is the tag
affecting the "Messages" text, rather than in the TABLE tag.

Additional Information
The source code for the link below demonstrates setting a number of
diffrent font properties using CSS inside a table.
Daniel Greene?s CSS Font Properties Test

- Hammer

Request for Answer Clarification by sjw-ga on 24 Mar 2005 12:39 PST
I need a template format for the export of my query from access and
what you have provided does not solve my problem. I'm using
DoCmd.OutputTo acOutputQuery, "Messages", acFormatHTML,
"C:\MessagesForAssociates2.html", 0, "C:\template.html"
in access to export a query but no matter what how I make the template
it does not change the font of the output of my query. Disregard the
caption and bold tags tag, I need to know what html code needs in the
template to change the font of the query's output.

Clarification of Answer by hammer-ga on 24 Mar 2005 13:46 PST
This is controlled by the query being run, not by the template. To
change the output font:
1. Run your query.
2. When you have the query results in a table in your screen, from the
Format menu, choose font.
3. Set the font options you want. Click OK.
4. Click the Save button.

Now, when you run the OutputTo command, it will use the font settings
saved in the query.

This worked fine, and my template file is simply as follows:

- Hammer

Request for Answer Clarification by sjw-ga on 24 Mar 2005 14:32 PST
The help inside access states that you can use a template, if this is
true, I would not have to manually changfe the font, correct? I don't
understand why it says you are able to use templates but I need this
to be an automated from a button without me having to manually change
the format.

Clarification of Answer by hammer-ga on 24 Mar 2005 14:38 PST
You can use a template to place the query output inside of other
standard content, such as navigation links, copyright notices and page
backgrounds. The format of the query output itself is controlled by
the settings on the query.

You only have to save the query font settings once. After that, your
button will always use the saved settings.

- Hammer
sjw-ga rated this answer:4 out of 5 stars
After my brain kicked in and I read the clarification, all is well thanks

Subject: Re: DoCmd.OutputTo in Microsoft access
From: willcodeforfood-ga on 24 Mar 2005 00:59 PST
Try somthing like this instead:

style="color:#FF0000; font-family:arial; font-size:24;

You need to apply attributes to the tag that is just before the
appearance of the text you want to modify, otherwise a tag that is
closer to the text may override the attribute.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy