By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 1,077 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

What's the best way to export a query dynaset in Access 2.0?

P: n/a
MLH
I don't want user to see the open query in a datasheet view.
I just want the dynaset written to c:\myfile.xls.

I was thinking...
DoCmd OpenQuery "qryAFAexcelExportData", A_NORMAL, A_READONLY
DoCmd DoMenuItem menubar, menuname, command [, subcommand] [, version]
....
But I don't know what to enter from there. I would like emulate
clicking File, Output To, OK (to accept Microsoft Excel (*.xls))
then typing c:\myfile.xls in the dialog box & clicking OK to actually
write the file.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
MLH
I'm thinking of changing my approach to using the
TransferSpreadsheet action. First, I use a make
table query to create the table I want. Then, I run
the XferSpreadsheet action something like this...

DoCmd TransferSpreadsheet A_EXPORT, 1, "AFAexportCRitems2Excel",
"c:\MyFile.xls", True

This seems to work OK for me. If there's some reason
you think I should use the DoMenuItem approach, pls
elaborate here.
Nov 12 '05 #2

P: n/a
MLH <CR**@NorthState.net> wrote in news:chk800p5cq03g5gsfrbpoepf7r2307lp6n@
4ax.com:
I'm thinking of changing my approach to using the
TransferSpreadsheet action. First, I use a make
table query to create the table I want. Then, I run
the XferSpreadsheet action something like this...

DoCmd TransferSpreadsheet A_EXPORT, 1, "AFAexportCRitems2Excel",
"c:\MyFile.xls", True

This seems to work OK for me. If there's some reason
you think I should use the DoMenuItem approach, pls
elaborate here.


There isn't.

And I'm guessing there is no reason to make a table. If you can write a
query that makes the table, then you can use a modifed version of the query
as the source for your TransferSpreadsheet.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #3

P: n/a
MLH
I thought I should be able to do that. Just could
figger out a way to do it. Any suggestions?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx
On 13 Jan 2004 22:31:26 GMT, Lyle Fairfield
<Mi************@Invalid.Com> wrote:
MLH <CR**@NorthState.net> wrote in news:chk800p5cq03g5gsfrbpoepf7r2307lp6n@
4ax.com:
I'm thinking of changing my approach to using the
TransferSpreadsheet action. First, I use a make
table query to create the table I want. Then, I run
the XferSpreadsheet action something like this...

DoCmd TransferSpreadsheet A_EXPORT, 1, "AFAexportCRitems2Excel",
"c:\MyFile.xls", True

This seems to work OK for me. If there's some reason
you think I should use the DoMenuItem approach, pls
elaborate here.


There isn't.

And I'm guessing there is no reason to make a table. If you can write a
query that makes the table, then you can use a modifed version of the query
as the source for your TransferSpreadsheet.


Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.