Hi every body
Can you please fix me errors.
Here are my codes and errors incountered
#Stage1
I want the user to type in the file path to txtpath.Text
and a text input to be appended to that file be written in txtwrite.Text
The error: Run Time error ->path not found
Don't hesitate on the file path. The file is definitely present.
Private Sub cmdappend_Click()
Dim filenum As Integer
Dim filepath As String
Dim textToWrite As String
textToWrite = txtwrite.Text
filenum = FreeFile()
filepath = txtpath.Text
Open filepath For Output As #filenum
While EOF(filenum)
Print #filenum, textToWrite
Wend
Close #filenum
End Sub
#problem2
for the same form
The error: Compile error ->method or data member not found
Private Sub cmdread_Click()
Dim filenum As Integer
Dim filepath As String
Dim textToDisplay As String
filenum = FreeFile()
filepath = txtpath.Text
Open filepath For Input As #filenum
While Not EOF(filenum)
Input #filenum, textToDisplay
Wend
txtoutput.Text = textToDisplay
Close #filenum
End Sub
#problem3
This is also for the same form
Th error: Compile time error -> path not found
Private Sub cmdwrite_Click()
Dim msg As String
Dim filenum As Integer
Dim filepath As String
Dim textToWrite As String
textToWrite = txtwrite.Text
filenum = FreeFile()
filepath = txtpath.Text
msg = "Do you want to cancel previous data in"
MsgBox msg + filepath + "?", vbOKCancel, "Pay Attention Embeza!"
'if vbOkCancel=Ok then continue. Dont otherwise
Open filepath For Output As #filenum
While BOF(filenum)
Print #filenum, textToWrite
Wend
Close #filenum
End Sub
Thank you every body in advance;)
Embeza