Hi Tim,
I'm not sure if this can solve your problem.
To write to a text file you need to write this code (I'm sure you know this very well):
Open App.Path & "\test.txt" For Output As 1
Print #1, Text1.Text; " ~ "; Text2.Text; " ~ "; Text3.Text; " ~ "; Text4.Text; " ~ "; Text5.Text; " ~ "; Text6.Text
Close #1
In between two text box I put '~' in order for me to easily split the text afterward
Next you said you want to read it and put it back to it relevant text box, here what I've done:
Dim s
Dim textfile As String
Dim strArray() As String
Open App.Path & "\try1.txt" For Input As 1
Do While Not EOF(1)
Line Input #1, textfile
strArray = Split(textfile, " ~ ")
For s = 0 To UBound(strArray)
If Not Trim(strArray(i)) = "" Then
Text1.Text = strArray(i)
Text2.Text = strArray(i + 1)
Text3.Text = strArray(i + 2)
Text4.Text = strArray(i + 3)
Text5.Text = strArray(i + 4)
Text6.Text = strArray(i + 5)
End If
Next
DoEvents
Loop
Close #1
Hope this can solve your problem.
Enter your message below
Sign in or Join us (it's free).