need help autocreating data entries

R

rich

I have 100-200 church songs in a folder with the title of each song as the
name. I would like to find a way to tell access to look at the folder and
create a new entry with the folder name in the name field and the song
lyrics in a memo section.
Is that possible?
 
A

Allen Browne

You will need to be comfortable with VBA code to achieve this.

First thing will be to loop through the files in the folder. Use Dir(). If
you need to recurse the subfolders as well, see:
List files recursively
at:
http://allenbrowne.com/ser-59.html

For the code to add the code as records in a table, see:
http://allenbrowne.com/ser-59alt.html

Now you need to loop through the text files, extracting the content, and
assigning it to a Memo field in the table you populated above.
OpenRecordset() on the table you created, and loop through the records. For
each of the file names you stored there, use Open (open for input) to get at
the file, and Line Input to read it line per line and append to a string
variable. Once you have the string, Edit the recordset, assign the string to
the memo field, and Update. Then Close the text file, and continue through
your recordset until you reach EOF.
 

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