Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Still trying to view linked text files - please help

Status
Not open for further replies.

DaveSH

Technical User
Aug 21, 2000
62
US
I am trying to display the contents of a text file in a scrolling text box on a form. I dont want to store the text in the database, just link it to a record and have it display in the form if the user wants while viewing the associated record.

This was my original approach, but I couldnt get it to work...

I have a bound OLE Frame on my form called "MyFrame" with its control source a table field. I have a command button that prompts the user to link the .txt file to the OLE field using insert object. I have a text box called "FinalDestination" and a command button called "ViewText" that has code Me![FinalDestination] = Me![MyFrame] in its on click event.

I get text in the text box but it contains a bunch of unreadable characters. The only readable text seems to be the file name, an icon file and "courier".

How can I get just the contents of the text file.

I would greatly appreciate any help.

Thanks
 
I have never done this kind of thing in Access myself, but I do see what might be a clue as to why your approach is not working. The occurrence of the font name "Courier" in your text suggests to me that the problem is with the text you are trying to read rather than with your Access technique. Make sure your ".txt file" is really a legitimate .txt file. It sounds to me as if it was produced by some kind of word processor instead of a text editor.

...Harold
 
Thanks for the response Harold,

The file is a legitimate text file. It appears (and Im guessing here) that the value of the OLE frame is not a the text contents of the linked file, but rather the package information that defines the OLE link the readable characters also appear to define the file icon displayed in the frame and Im thinking courrier is the the font the filename displayed under thr icon appears in. If I change the .txt extension to .doc, I can see "Microsoft Word" imbeded in the text also so I assume access is making assumptions about the file type based on the extension. In either case, Im thinking that the aproach is flawed. I am going to go with having the file open in notepad for now, but I really want to have the file import into the text box dirrectly. Any ideas welcome.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top