Transfertext via Macro

G

Guest

Can someone help me please? I have a form in which I have placed a button
using the TransferText macro.

This is supposed to export a .txt/.csv. I have several queries which need to
be exported and they vary. Some are .csv some are .txt and some are tab
delimited and some are comma. Using the TransferText macro, there is no way
that you can control this as in the right click on query and export option.

Does any one have any ideas?

Many thanks
 
K

Ken Snell [MVP]

You control this in a macro by using different export specifications as
needed (they control the delimiter being used) and by using different
filenames for the output file (they control the file extension).

Are you wanting to use a single macro for all situations? Or can you have a
different macro for each situation?

Please provide more details about what you want to do.
 
G

Guest

Thank you for your suggestion Ken. I have tried this but not gone far. I can
set a different macro for each of the files that's no problem. I am getting
stuck when it comes to the delimiters. Where do you say tab or comma
delimited? And where do you set where the fields have "" or not?

Can you give me a screen shot maybe? My email is (e-mail address removed)

Many thanks.
 
K

Ken Snell [MVP]

You will need to create an export specification for each type of file. You
do this by manually beginning to export a table/query, and when the export
wizard window appears, go through all the steps until you get the last
screen (to do the actual export). On that screen, at lower left, you'll find
an Advanced button. Click that button. You'll get a screen that has all of
your settings displayed. Click the Save As button on that screen and choose
a name for the specification. Then you can cancel the export.

You then can use that specification in the TransferText action as the
SpecificationName argument.
--

Ken Snell
<MS ACCESS MVP>
 
G

Guest

Many thanks for taking the time to help me Ken. A happy new year to you.

Regards,
John
 

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