Results 1 to 6 of 6
  1. #1
    HDobler is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    7

    Copy text file to Memo Field

    I am looking for ideas on how to copy the text from a text file and insert the entire text of that file into a memo field.

    I am working on a document retrieval database. Each document has a document number. I have a record in the database for each document with a document number field containing that unique document number. The text file containing the text of that document is named XXX.txt where XXX is the document number.

    I need to some up with some type of routine that can be called with the document number and go open that file, read the entire file of text data and copy that data into the memo field which is named Text of Story.

    To build on that would be something that can be batch run with a condition or query of Processing Stage <= 500. I have several steps involved and each step has a number. I only want to process this for entries that have not already been processed for this stage which is identified by a Process Stage less than the number of this step which for now say is 500

    Thank you in advance for any suggestions or code snippets.

    Harry

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    Why does the text have to be stored in a memo field? Is that some mandatory instruction? This sounds a little bit like a home work assignment. Is it?

    You could leave the full text on the file system, and record the folder and filename in your database.
    And have the text presented when needed.

    There are a number of free data models at http://www.databaseanswers.org/data_...all_models.htm

    Some of these deal with Documents and document management.

    good luck with your project.

  3. #3
    HDobler is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    7
    Maybe I am overthinking this or making it harder than it needs to be. Let me back up and explain from beginning in case I got off on wrong track.

    I have documents that I receive from a coworker. These are either PDF or Word files. I need to be able to log these documents in an Access database and do 2 things with them. I need to be able to bring up the original document in its original form. I am currently doing this by creating a hyperlink the original file. I also have to be able to do a search for particular phrases or names in the documents. I tried but was unable to get Access to go out and read external files as part of a query even if they were text files. As a result for the search option, I added a memo field so that I was not limited on length of text. From each Word or PDF file, I am creating a text file of unformatted text. I am looking for a way to take those text files and add their text to the associated memo field. I have 1 record for each document. Each document has a number. The Word/PDF file and the .txt each are named by document number.

    Any help would be greatly appreciated even if that help is telling me I went about his all wrong.

    I also would like to be able to print a copy of the original Word/PDF file in a report if that is possible but I have not asked that question yet.

    Harry

  4. #4
    HDobler is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    7
    Any suggestions would be greatly appreciated. If I posted in wrong forum and should post elsewhere, please of that also.

    The short version of my question is suggestions on how to take a .TXT file, open it and copy the entire contents of that file into a memo field. More detailed information is listed above if needed.

    Thank you in advance for any suggestions given.

  5. #5
    Wasser2021 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jun 2021
    Posts
    10
    Hi folks, I have a similar problem, simple things are very complicated in VBA. Simply copying a variable into a data field is not intended. Where is the mistake ?

  6. #6
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Quote Originally Posted by Wasser2021 View Post
    Hi folks, I have a similar problem, simple things are very complicated in VBA. Simply copying a variable into a data field is not intended. Where is the mistake ?
    You have posted on the end of a 8 year old thread.
    I would suggest starting a new thread with some examples of what you have tried and where you are getting an error.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Change Text field to Memo Field in a Query
    By Yarbz in forum Queries
    Replies: 5
    Last Post: 06-28-2012, 05:24 PM
  2. Replies: 5
    Last Post: 06-19-2012, 10:46 AM
  3. rich text memo field
    By jedder in forum Reports
    Replies: 1
    Last Post: 05-11-2012, 02:48 PM
  4. Highlight text in memo field
    By silverspr in forum Programming
    Replies: 2
    Last Post: 03-27-2011, 04:58 PM
  5. copy data from text file into table in access
    By miziri in forum Programming
    Replies: 3
    Last Post: 08-12-2009, 03:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums