VBA Code to run a query and then export the query as a fixed width .txt file (1 Viewer)

keevo

New member
Local time
Today, 03:19
Joined
Oct 15, 2014
Messages
3
Hi All

basically im trying to setup a click button that will export my query as a text file ( the text file will then be fixed width and i have already setup the specifications for this)

i think i get how to complete the export part as below

OutFilePath = "file location i want the data to be exported to"

DoCmd.TransferText acExportFixed, "Welcome output query Export Specification", WelcomeOutput, OutFilePath, True

i just dont know how to run the query and link it to the export

Hope this makes sense and thanks in advance for any support provided.
 

namliam

The Mailman - AWF VIP
Local time
Today, 04:19
Joined
Aug 11, 2003
Messages
11,695
Where you have "WelcomeOutput" is where you should have your query, it will automagicaly be ran when the export takes place.
 

keevo

New member
Local time
Today, 03:19
Joined
Oct 15, 2014
Messages
3
Brilliant thanks :)
 

Users who are viewing this thread

Top Bottom