Nov 2, 2006 #1 Cloonalt Programmer Jan 4, 2003 354 US How can I pass data to a .txt file. For example, I want a file named (fieldname).txt. I want to write data to it: Name: data Address: data Hope that makes sense. Any help is appreciated.
How can I pass data to a .txt file. For example, I want a file named (fieldname).txt. I want to write data to it: Name: data Address: data Hope that makes sense. Any help is appreciated.
Nov 2, 2006 1 #2 Remou Technical User Sep 30, 2002 13,030 BE You can use the Open Statement or the FileSytemObject (TextStream). Upvote 0 Downvote
Nov 2, 2006 Thread starter #3 Cloonalt Programmer Jan 4, 2003 354 US Can you point me to an example of that code? Thanks. Upvote 0 Downvote
Nov 2, 2006 1 #4 abaldwin Programmer Mar 27, 2001 798 US Something to start with dim stFilename as string dim stName as string dim stAddress as string stfilename = "C:\mytext.txt" Open stfilename for output as #1 Place code here to fill the variables from wherever you get them (db or controls or whatever) print #1 "Name: " & stname Print #1 "Address: " & staddress close recordsets Close #1 Standard open file and write to it. Many examples on web. Andy Baldwin "Testing is the most overlooked programming language on the books!" Ask a great question, get a great answer. Ask a vague question, get a vague answer. Find out how to get great answers FAQ219-2884. Upvote 0 Downvote
Something to start with dim stFilename as string dim stName as string dim stAddress as string stfilename = "C:\mytext.txt" Open stfilename for output as #1 Place code here to fill the variables from wherever you get them (db or controls or whatever) print #1 "Name: " & stname Print #1 "Address: " & staddress close recordsets Close #1 Standard open file and write to it. Many examples on web. Andy Baldwin "Testing is the most overlooked programming language on the books!" Ask a great question, get a great answer. Ask a vague question, get a vague answer. Find out how to get great answers FAQ219-2884.
Nov 2, 2006 #5 Remou Technical User Sep 30, 2002 13,030 BE Open Statement: http://msdn.microsoft.com/archive/d...e/en-us/office97/html/output/F1/D6/S5B27D.asp FileSystemObject: http://msdn.microsoft.com/library/d...html/a3f17c7a-69a2-47d8-8b40-6a74646f4e1d.asp Upvote 0 Downvote
Open Statement: http://msdn.microsoft.com/archive/d...e/en-us/office97/html/output/F1/D6/S5B27D.asp FileSystemObject: http://msdn.microsoft.com/library/d...html/a3f17c7a-69a2-47d8-8b40-6a74646f4e1d.asp