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

Pass variables to a .txt file 2

Status
Not open for further replies.

Cloonalt

Programmer
Jan 4, 2003
354
0
0
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.
 
You can use the Open Statement or the FileSytemObject (TextStream).
 
Can you point me to an example of that code?

Thanks.
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top