View Full Version : OutputTo Action in a macro does not allow delimiter specification


Alexander
07-08-2010, 02:18 PM
Hello all,

After a lot of playing around, I have designed an Access file which massages data and produces a text file. I am using an "OutputTo" action within a macro to dump the data in a txt file on a local machine. All is well except for one big problem:

I cannot see where "OutputTo" function allows for a delimiter to be specified. Also, Access dumps the file with "----" characters in between each row.

This can be easily handled if "Export To Text File" button is manually pushed (a window pops up asking the user to specify delimiter, and there is a check box labeled "Export data with formatting and layout" which can be unchecked). How can these parameters be specified within a macro, so the user can just run it and get a finished result automatically? Essentially, how can a macro's "OutputTo" action be customized to export data without formatting and layout.

Thanks for your help in advance.

boblarson
07-08-2010, 02:25 PM
Use DoCmd.TransferText because you can use an Export Specification that you've set up in advance.

Alexander
07-08-2010, 02:28 PM
Use DoCmd.TransferText because you can use an Export Specification that you've set up in advance.


Hi Bob,

Thank you very much for your prompt response.

Can you please expand on your answer - since I am using a macro, there is no code involved. Where can I inject this code? Or are you referring to creating a function? Where can these preset setting be pulled from?

Thanks again!!!

boblarson
07-08-2010, 02:34 PM
Hi Bob,

Thank you very much for your prompt response.

Can you please expand on your answer - since I am using a macro, there is no code involved. Where can I inject this code? Or are you referring to creating a function? Where can these preset setting be pulled from?

Thanks again!!!

Okay, here's how you create an Export Specification (http://www.btabdevelopment.com/ts/03expspec).

And then in your macro you can use the Action TRANSFER TEXT and there is an argument for the name of an Export Specification you've set up.

Alexander
07-08-2010, 02:57 PM
Okay, here's how you create an Export Specification (http://www.btabdevelopment.com/ts/03expspec).

And then in your macro you can use the Action TRANSFER TEXT and there is an argument for the name of an Export Specification you've set up.


THANK YOU! Mr. BobLarson! You made my day. This is exactly what I had in mind. Thanks again! Oh, this is so great.

boblarson
07-08-2010, 03:05 PM
Glad to be able to help. :)