|
-
Feb 25th, 2008, 04:02 PM
#1
Thread Starter
Member
[RESOLVED] How to add a name to a textfile??
Hello, me again
I have a textfile (c:\data.txt) with a lot of names in it.
Jack
Bruce
Roger
and so on..
All these names are loaded in a ListBox (List1) on Form Load.
I also have a TextBox (txtName) so people can add names to it. When clicking on "Command1" the new name will first be added to the textfile (c:\data.txt) and then it will be added to the ListBox (List1)
The problem is that the new name thats saved to the textfile (c:\data.txt) is added like this:
Jack
Bruce
RogerNew name
I want the new name being added like this:
Jack
Bruce
Roger
New name
The code i use for saving the new name to the textfile (c:\names.txt) is this:
'Add new name to textfile
Open App.Path & "\names.txt" For Append As #1
Print #1, txtName.Text;
Close #1
Can someone tell me what im doing wrong?
Thanks,
Warad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|