Export data

  • Thread starter Thread starter Hari
  • Start date Start date
H

Hari

Hi,

I have created a macro with 'TransferText' action to
export the data from a query to a CSV file. How can I pass
the path for this CSV file dynamically at run time?

TIA,
Hari
 
Hari,

Where does the path come from? Manual user entry? Selection from a given set
of options? Or what?

Nikos
 
Hari,

Assuming the user enters the path in a textbox, say txtPath, on form Form1
(the textbox must be unbound), then the File Name argument in your
TransferText action in the macro would be:

=[Forms]![Form1].[txtPath] & "YourFilename.csv"

This will read the path form the textbox on the form and concatenate the
file name.
Note:
1. The form must remain open while the macro is run; a good idea is to run
the macro from a command button on the same form.
2. The path must include a "\" at the end; alternatively, the backslash can
be included at the beginning of the file name, but in any case there needs
to be one (and only one).

HTH,
Nikos
 
Back
Top