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
 
Back
Top