Macro export to text file help

KenshiroUK

Registered User.
Local time
Today, 22:08
Joined
Oct 15, 2012
Messages
160
Hi there, I have created 2 queries that when ran create a table with a list of orders ready to be imported to a text file. However I need some help on running a macro to export specific columns from the table into a text document. Anybody know how I can go about doing this?

I have in my tables 'Order-Item-ID' which is the one I wish to drop. 'Service', 'Service Ref' 'Customer Name' 'Address', 'Adress2' 'City', 'County', 'Post Code' 'Country' 'email' 'telephone', 'quantity', 'weight' 'signature'.
 
I am not sure about macros, but you can use VBA.. It is simple.. use the DoCmd.OutputTo..
Code:
DoCmd.OutputTo acOutputTable,"[B][COLOR=Blue]yourTableName[/COLOR][/B]"
Once you run this code it will prompt for the format and file name.. however you can also specify the type and name in the line itself..
Code:
DoCmd.OutputTo acOutputTable,"[B][COLOR=Blue]yourTableName[/COLOR][/B]", ,acFormatTXT, "C:/Dum.txt"
 

Users who are viewing this thread

Back
Top Bottom