specifying fields for excel output w/ DoCmd.OutputTo

  • Thread starter Thread starter krafter74
  • Start date Start date
K

krafter74

I am using DoCmd.OutputTo (in Access 2000) to export an access table
to an excel spreadsheet. I want to hide or leave some of my numeric
code fields out of the exported file, but can't seem to specify
exported fields with DoCmd.

For example, I have a 3 digit code for county that is used only in a
query to build the table.

Can anyone suggest a way to specify the table fields that are exported
to an excel spreadsheet? Perhaps this is not possible.
 
-----Original Message-----
I am using DoCmd.OutputTo (in Access 2000) to export an access table
to an excel spreadsheet. I want to hide or leave some of my numeric
code fields out of the exported file, but can't seem to specify
exported fields with DoCmd.

For example, I have a 3 digit code for county that is used only in a
query to build the table.

Can anyone suggest a way to specify the table fields that are exported
to an excel spreadsheet? Perhaps this is not possible.
.
Hi krafter74, have you tried setting up a query with the
required fields for this purpose (instead of using this
table)?

Luck
Jonathan
 
This is a great idea, and it seems like it should work, but I just got
a runtime error '3021: No current record'. So it seems like I need to
run the query before I try to export it. Can you tell me the code to
do that?

many thanks,
Kevin
 
More followup - I don't want the user to see a query run. I've been
playing with using a macro to run the spreadsheet but that's not
working too well. The OutputTo command is useful because you can make
the user do the 'Save As...' and then it will open Excel.

thanks in advance,
Kevin
 

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

Similar Threads

Dump a report into Excel 1
too many rows to output 1
export to Excel 1
export query data to excel in a specific worksheet. 2
Export to Excel 1
export query to excel 3
output file 3
Exporting To Excel 5

Back
Top