Can I add a header to an "OpenQuery" report?

M

Max Moor

Hi All,
I want to open a query, and print it out. Right now, I'm using the
code:

DoCmd.OpenQuery "qryMyQuery", acViewPreview

Of course, when the query opens, the heading is "qryMyQuery." Is
there an alternate way to open a query, and be able to specify a heading?

- Max
 
F

fredg

Hi All,
I want to open a query, and print it out. Right now, I'm using the
code:

DoCmd.OpenQuery "qryMyQuery", acViewPreview

Of course, when the query opens, the heading is "qryMyQuery." Is
there an alternate way to open a query, and be able to specify a heading?

- Max

You have no control over the heading of a query (other than hiding it
completely by making the page header small).

Create a report. Use the query as the report's recordsource.
Now you can write whatever you want in the report or page header.
 
M

Max Moor

You have no control over the heading of a query (other than hiding it
completely by making the page header small).

Create a report. Use the query as the report's recordsource.
Now you can write whatever you want in the report or page header.

Hi Fred,
The problem is that the query changes. Depending on various options
set before it's created, it has different numbers of different fields each
time. I don't know how to build a report that can handle that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top