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

Recording Info in Text File from VB Form

Status
Not open for further replies.

KellyStee

Technical User
Jul 30, 2001
106
US
I have a form with text boxes, check boxes, toggle buttons and so forth and before the form is reset, I want the user to be able to record the results in a text file that is saved on their hard drive. I've checked out MSDN on this subject and haven't found much about how to go about doing this. I did find one article, "Interacting with Data in an ASCII Text File" but it seems to deal more with an ASCII delimited text file and accessing and updating a recordset.

Can anyone point me in the right direction?

Thanks!
Kelly
 
Try using the old Open statement:

-------------------------

Open "c:\output.txt" For Output As #1

Write #1, Text1.Text, Check1.Value, .......

Close #1

-------------------------

Open "c:\output.txt" For Input As #1

Input #1, Text1.Text, Check1.Value, .......

Close #1

-------------------------

Thats just a basic shell, you would obviously want to add some validation and value checking first.

-Adam-
 
Thanks, Adam! That works for me. I wasn't familiar with the Open function. One question I have related to my project is how do I append to an existing file? I need to create a new file if the specified file name doesn't already exist, and I need to append to the file, if it does already exist.

Thanks!
Kelly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top