I have an Access database that has 13 tables which I need to export into 13 .csv files with the same name as the tables. I am attempting to do this with VBA in Access 2003.
So far I have used DoCmd.TransferText and hard coded the file names into the VBA code. I would like to use an "InputBox" to require the user to input at date which would be used to create a folder on a network drive which the .csv files would be created in. Something along the lines of this.
-Box comes up, already got this to occur (kind of?), and asks for date
-User inputs date, 2005-09-20, a folder called "Data Submission 2005-09-20" is created in this folder "\\CSServer\SPShare\MIS\Future\Data Submission 2005\"
-All Access table would be exported, "table1" would be "table1.txt", as delimited files with the .txt extension.
I don't have much experience in VBA but this is what I have gotten so far.
Those lines do not wrap in the VBA window.
This would save alot of time over exporting each table manually.
TIA,
Paul
So far I have used DoCmd.TransferText and hard coded the file names into the VBA code. I would like to use an "InputBox" to require the user to input at date which would be used to create a folder on a network drive which the .csv files would be created in. Something along the lines of this.
-Box comes up, already got this to occur (kind of?), and asks for date
-User inputs date, 2005-09-20, a folder called "Data Submission 2005-09-20" is created in this folder "\\CSServer\SPShare\MIS\Future\Data Submission 2005\"
-All Access table would be exported, "table1" would be "table1.txt", as delimited files with the .txt extension.
I don't have much experience in VBA but this is what I have gotten so far.
Code:
Sub ExportJTAtoText()
NewFolderName = InputBox("Input today's date in the YYYY-MM-DD format", "Create Folder", "Please enter a date")
DoCmd.TransferText acExportDelim, , "informix_app", "c:\Youth\informix_app.txt", True
DoCmd.TransferText acExportDelim, , "informix_case_tbl", "c:\Youth\informix_case_tbl.txt", True
DoCmd.TransferText acExportDelim, , "informix_clnt", "c:\Youth\informix_clnt.txt", True
DoCmd.TransferText acExportDelim, , "informix_partic_grnt", "c:\Youth\informix_partic_grnt.txt", True
DoCmd.TransferText acExportDelim, , "informix_wia_app", "c:\Youth\informix_wia_app.txt", True
DoCmd.TransferText acExportDelim, , "root_jtpa_supp_data", "c:\Youth\root_jtpa_supp_data.txt", True
DoCmd.TransferText acExportDelim, , "root_wia_agcy", "c:\Youth\root_wia_agcy.txt", True
DoCmd.TransferText acExportDelim, , "root_wia_base_wg", "c:\Youth\root_wia_base_wg.txt", True
DoCmd.TransferText acExportDelim, , "root_wia_ipd_actvy", "c:\Youth\root_wia_ipd_actvy.txt", True
DoCmd.TransferText acExportDelim, , "root_wia_ipd_app", "c:\Youth\root_wia_ipd_app.txt", True
DoCmd.TransferText acExportDelim, , "root_wia_ipd_case", "c:\Youth\root_wia_ipd_case.txt", True
DoCmd.TransferText acExportDelim, , "root_wia_ipd_folup", "c:\Youth\root_wia_ipd_folup.txt", True
DoCmd.TransferText acExportDelim, , "root_wia_ipd_goal", "c:\Youth\root_wia_ipd_goal.txt", True
End Sub
Those lines do not wrap in the VBA window.
This would save alot of time over exporting each table manually.
TIA,
Paul