Unbound text control, read from/write to text file

  • Thread starter Thread starter Song Su
  • Start date Start date
S

Song Su

How to have unbound txtMailBody read content from a txt file and write to a
txt file? I want user to have his own default content of email body which is
from last time he run it.

Thanks
 
Why not use a table instead of a text file? Access is designed to use tables.
To use a text file you need to reference the File System Object. Google it to
find out the details of using it.
Since the control is unbound you can read the data in the Current event
based on the primary key of your table record.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
The application is designed to be shared with many users and I want each
user has his own default content. That's why I cannot use table. I'll check
out File System Object.
 
You would be better off using VBAs native file handling to open and read a
text file vs the FileSystemObject.

The FileSystemObject is a part of Windows Scripting and may not be
accessible on all computers due to Security Settings notwithstanding most
developers eschew its' use because of the several variations (versions) of
the Scripting Runtime that may not be 100% compatible with your code,
whereas VBA will always work.

I have used the FileSystem Object, but only in the Scripting environment.
 
Back
Top