|
-
Mar 14th, 2003, 05:21 PM
#1
Thread Starter
Lively Member
textfile
hi did the following code so when it saves everything in the label and text box to a text.file
when i add new data in the text boxes and save it, overrides the old text file.
what i need is everytime i add new data to text boxes and save it creates a new text file no overide the previous one created
Private Sub mnuFileSave_Click()
Open "C:\Program Files\Project\Project .txt" For Output As #1
Print #1, "Label1. " & label2 & " saved at " & Now & "."
Print #1, "label3 " & text1 & " " & text2 & " " & text3 & " " & text4
Close #1
End Sub
-
Mar 14th, 2003, 05:28 PM
#2
Fanatic Member
Where it sais for output change to for append
ok
Cheers
-
Mar 14th, 2003, 05:49 PM
#3
Thread Starter
Lively Member
tried that but doesn't create a new one
-
Mar 14th, 2003, 06:38 PM
#4
Thread Starter
Lively Member
Ok me other problem is i got a list box with a list called eur, chf and gbp
when i switch from eur to chf it clears all enties i had in the textboxes in main form what i am trying to achieve is: if i working on say the euro list i want all the info in text boxes to be save in a text file called eur then when i switch list chf and do entries there it also saves to a text file called chf then when i go back to list eur list it brinks back all the data from the textfile and puts back in the appropriate textboxes
-
Mar 14th, 2003, 06:58 PM
#5
Fanatic Member
Do it this way using a commondialog1 control
this will allow you to save in anew file where you want
VB Code:
Private Sub mnuFileSave_Click()
CommonDialog1.Filter = "Text files,(*.txt)|*.txt|"
CommonDialog1.ShowSave
Open CommonDialog1.FileName For Output As #1
Print #1, Text1.Text
Print #1, Label1
Close #1
-
Mar 14th, 2003, 07:20 PM
#6
Frenzied Member
if you want to use your first method, simply change the name of the output file. You can't save to the same file repeatedly.
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
|