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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy content of file.txt into Me.memofield on Access Form 1

Status
Not open for further replies.

KUZZ

Technical User
Aug 13, 2002
254
GB
I am trying at the push of a button on an Access form to copy contents of simple text file "c:\file.txt" into a memo field "memo" on the same Access form. Has anyone done this before? Please help.

Good luck,
Kuzz

"Time spent debating the impossible subtracts from the time during which you
can try to accomplish it."
 
This may suit:
Code:
Set fs = CreateObject("Scripting.FileSystemObject")
Set strFile = fs.OpenTextFile("Document1.txt", 1)
strText = strFile.ReadAll
Me.txtMemo = strText
strFile.Close
 
Thanks for the tip, worked like a charm.

Good luck,
Kuzz

"Time spent debating the impossible subtracts from the time during which you
can try to accomplish it."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top