Exporting queries...

  • Thread starter Thread starter hermanko
  • Start date Start date
H

hermanko

Hi all,

Is it possible to use the OutputTo action to export a query/table, but
EXCLUDE certain fields?

For example, I want have tables that use an ID field as the primary
key. But when I export, I don't want to have that Field in the excel
worksheet because it really has no significance to the reader of the
excel file. I also have a Checkbox field that I don't want in the
exported file.

Thanks!
Herman
 
Is it possible to use the OutputTo action to export a query/table, but
EXCLUDE certain fields?

For example, I want have tables that use an ID field as the primary
key. But when I export, I don't want to have that Field in the excel
worksheet because it really has no significance to the reader of the
excel file. I also have a Checkbox field that I don't want in the
exported file.


I don't understand the issue. Why not just create a query
that does not include those fields?
 
Sure. Create a query that limits the return the way you want and save it.

In code it would look something like below. You can do similar things with a
macro.

DoCmd.OutputTo acQuery, "qry_Estimates_All", "MicrosoftExcelBiff5(*.xls)",
"D:\Estimates_All.xl", False, "", 0
 
Hi all,

Is it possible to use the OutputTo action to export a query/table, but
EXCLUDE certain fields?

For example, I want have tables that use an ID field as the primary
key. But when I export, I don't want to have that Field in the excel
worksheet because it really has no significance to the reader of the
excel file. I also have a Checkbox field that I don't want in the
exported file.

Thanks!
Herman

Open the query in design view, and uncheck the Show checkbox under
these fields.

John W. Vinson[MVP]
 
Back
Top