By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,426 Members | 2,928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,426 IT Pros & Developers. It's quick & easy.

How to export a table to a text file using different export specifications

P: 2
I need to export 2 tables to the same text file.
The 2 tables must be exported using different export specifications to the same text file --> the file must be cumulative.
Can I do this in Access??? If yes, advise how to do it.
Apr 25 '10 #1
Share this Question
Share on Google+
4 Replies


ADezii
Expert 5K+
P: 8,638
@rachapinky
I don't think that you can do this, but what you can do is to Export the 2 Tables separately with their own Export Specs, then concatenate them into what the Original File Name should be, namely:
  1. Export Table1 as Table1.txt
  2. Export Table2 as Table2.txt
  3. Concatenate both Text Files into a Single File
  4. Assuming that you are executing this Line of Code from the same Folder where both Files exist:
    Expand|Select|Wrap|Line Numbers
    1. Copy Table1.txt + Table2.txt Table3.txt
  5. The contents of Table2.txt will be added to the contents of Table1.txt and can be viewed in Table3.txt
Apr 25 '10 #2

P: 2
@ADezii
thank you very much for your answer.
can this concatenation be done using a query or a module in access???
Apr 26 '10 #3

ADezii
Expert 5K+
P: 8,638
@rachapinky
This can be done in VBA code immediately after the Exports of the 2 Reports, but I am going out for the evening. Will show you how it is done tomorrow,
Apr 26 '10 #4

ADezii
Expert 5K+
P: 8,638
Let's assume that both Reports were Exported to the C:\Reports\ Folder as 1.txt and 2.txt consecutively. To concatenate the results of both Reports to a single File named 3.txt, in the same Folder:
Expand|Select|Wrap|Line Numbers
  1. Dim retVal
  2.  
  3. retVal = Shell("cmd /c Copy C:\Reports\1.txt + C:\Reports\2.txt C:\Reports\3.txt", vbMinimizedNoFocus)
Apr 27 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.