Import multiple text file into memo field table

R

R Alapatt

I generate credit reports that I can print into a multiple .txt files, each
holding a credit report. This process also generates a summery file that
holds the id for each credit report and the name of the .txt file to which it
saved the credit report. Using Access I am able to import the summery file
and hence have the id and the name of the .txt file as fields. I need to
import each of the .txt file as a whole into a memo field. Ultimately, I
should have a table with memo fields and each record is one credit report.
Any suggestion is appreciated. Thank you.
 
J

John Nurick

If each record contains the name of the associated text file and there's
a memo field ready for the contents of the file, you can use the
FileContents() function at
http://www.j.nurick.dial.pipex.com/Code/VBA/FileContents.htm in an
update query.

For instance, if the file name is in the FileName field and the files
are in "D:\Folder\Subfolder\", you'd update the memo field to:

FileContents("D:\Folder\Subfolder\" & [FileName])
 
R

R Alapatt

Thank you John. I added a memo field in the summery table. I then created a
module with your function - saved and compiled without error. I then created
a update query and in the update to enter FileContents([FileName]). The
FileName field has the complete path to the file. But when I run the query
it gives me
-ambigous name in query extression 'FileContents([reports!FileName})'- What
am I doing wrong. I am not familier with VB. But know Java.
Rose

John Nurick said:
If each record contains the name of the associated text file and there's
a memo field ready for the contents of the file, you can use the
FileContents() function at
http://www.j.nurick.dial.pipex.com/Code/VBA/FileContents.htm in an
update query.

For instance, if the file name is in the FileName field and the files
are in "D:\Folder\Subfolder\", you'd update the memo field to:

FileContents("D:\Folder\Subfolder\" & [FileName])


I generate credit reports that I can print into a multiple .txt files, each
holding a credit report. This process also generates a summery file that
holds the id for each credit report and the name of the .txt file to which it
saved the credit report. Using Access I am able to import the summery file
and hence have the id and the name of the .txt file as fields. I need to
import each of the .txt file as a whole into a memo field. Ultimately, I
should have a table with memo fields and each record is one credit report.
Any suggestion is appreciated. Thank you.
 
R

R Alapatt

John Please ignore the previous message. I tried again and it worked! Thank
A lot. Rose

R Alapatt said:
Thank you John. I added a memo field in the summery table. I then created a
module with your function - saved and compiled without error. I then created
a update query and in the update to enter FileContents([FileName]). The
FileName field has the complete path to the file. But when I run the query
it gives me
-ambigous name in query extression 'FileContents([reports!FileName})'- What
am I doing wrong. I am not familier with VB. But know Java.
Rose

John Nurick said:
If each record contains the name of the associated text file and there's
a memo field ready for the contents of the file, you can use the
FileContents() function at
http://www.j.nurick.dial.pipex.com/Code/VBA/FileContents.htm in an
update query.

For instance, if the file name is in the FileName field and the files
are in "D:\Folder\Subfolder\", you'd update the memo field to:

FileContents("D:\Folder\Subfolder\" & [FileName])


I generate credit reports that I can print into a multiple .txt files, each
holding a credit report. This process also generates a summery file that
holds the id for each credit report and the name of the .txt file to which it
saved the credit report. Using Access I am able to import the summery file
and hence have the id and the name of the .txt file as fields. I need to
import each of the .txt file as a whole into a memo field. Ultimately, I
should have a table with memo fields and each record is one credit report.
Any suggestion is appreciated. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top