Criterial for the Exort.

S

sigh

Hi,
I use this transferText method for my export with no
problem.
DoCmd.TransferText acExportFixed, "Report
Export", "qryReport", "C:\Name.txt"

But instead of always save as "Name.txt", I would like it
prompt me with "SAVE AS" Box. So, I can input the
different name everytime when I click on the export
command to export the file. How do I do that? What's vba
Code?

Any help would be very appreciate.
 
J

Joe Fallon

Build a form and add a textbox to it named txtFileName.
Then refer to the textbox in the TransferText code instead of a hardcoded
value.

DoCmd.TransferText acExportFixed, "Report Export", "qryReport", "C:\" &
Me![txtFileName]
 
S

sigh

ou indecate.
Thanks for the reply. But, after I change the code as
you indecate, I got a message as "Can not update. Database
or Object is read only" . How Come?
-----Original Message-----
Build a form and add a textbox to it named txtFileName.
Then refer to the textbox in the TransferText code instead of a hardcoded
value.

DoCmd.TransferText acExportFixed, "Report Export", "qryReport", "C:\" &
Me![txtFileName]

--
Joe Fallon
Access MVP



sigh said:
Hi,
I use this transferText method for my export with no
problem.
DoCmd.TransferText acExportFixed, "Report
Export", "qryReport", "C:\Name.txt"

But instead of always save as "Name.txt", I would like it
prompt me with "SAVE AS" Box. So, I can input the
different name everytime when I click on the export
command to export the file. How do I do that? What's vba
Code?

Any help would be very appreciate.


.
 

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