Y
Yamou
Hi,
MY QUESTION: HOW DO I REWRITE MY MACRO so that it cycles through the 16
results of a query and uploads the 16 resulting text files to my database in
one run.
1. My currently working macro (compacted here for space) to import ONE file
at a time from a specific directory to the open database:
....
FilePath = "T:\InternationalPrograms\Finance\2008-10
NAIROBI-Transactions(BON).txt"
DoCmd.TransferText acImportDelim, "Transactions Import Specification", _
"tbl_PR_Transactions", FilePath
GoTo ExitSub
....
The ""T:\InternationalPrograms\Finance\" portion of the FilePath remains
constant for all reports. The "2008-10 NAIROBI-Transactions(BON).txt" text is
created for 16 subs in a query. The callenge: splitting the FilePath String
in two so that the second part is pulled automatically for all records in my
query and each time uploaded to my database in one run of my macro.
Note: I am an occasional VBA writer, just smart enough to adapt simple codes
to my needs. Thanks for your help!
MY QUESTION: HOW DO I REWRITE MY MACRO so that it cycles through the 16
results of a query and uploads the 16 resulting text files to my database in
one run.
1. My currently working macro (compacted here for space) to import ONE file
at a time from a specific directory to the open database:
....
FilePath = "T:\InternationalPrograms\Finance\2008-10
NAIROBI-Transactions(BON).txt"
DoCmd.TransferText acImportDelim, "Transactions Import Specification", _
"tbl_PR_Transactions", FilePath
GoTo ExitSub
....
The ""T:\InternationalPrograms\Finance\" portion of the FilePath remains
constant for all reports. The "2008-10 NAIROBI-Transactions(BON).txt" text is
created for 16 subs in a query. The callenge: splitting the FilePath String
in two so that the second part is pulled automatically for all records in my
query and each time uploaded to my database in one run of my macro.
Note: I am an occasional VBA writer, just smart enough to adapt simple codes
to my needs. Thanks for your help!