My program takes data from text boxes A, B and C and puts it into a txt.file as a comma delimited sequential file.
I can then retrieve the data into a ListBox for editing and am having trouble trying to put the edited data back into a txt.file in the same format. I have tried various ways without success.
This is the save that I have been trying, I have dimensioned A, B and C as option explicit and have tried dimensioning within the Save without success. I have Rem'd the results of my attempts so that I wasn't trying the same thing repeatedly and everything is temporarily Rem'd
When I put the data back into the ListBox it doesn't show any commas or quotes and I don't know whether it should or not.
Can someone please tell me what I am doing wrong.
Private Sub cmdSave_Click()
Dim i As Integer
Open App.Path & "\List.txt" For Output As #1
'For i = 0 To List1.ListCount - 1
'Write #1, List1.List(i) 'this saves each line between one set of quotes
'Write #1, A(i), B(i), C(i) 'expected array error
'Print #1, List1.List(i) 'Prints the list without the quotes
'Write #1, List1.List(i) 'writes a full line between 2 quotes
'Next
'Print #1, A, B, C 'prints one line with large spaces without quotes
'Write #1, A, B, C 'this just writes the last line of the list
'Do Until EOF(1)
'Print #1, List1.Text 'prints nothing
'Write #1, List1 'Just prints quotes with no data
'Print #1, List1 'prints nothing
'Loop
Close #1
End Sub
I can then retrieve the data into a ListBox for editing and am having trouble trying to put the edited data back into a txt.file in the same format. I have tried various ways without success.
This is the save that I have been trying, I have dimensioned A, B and C as option explicit and have tried dimensioning within the Save without success. I have Rem'd the results of my attempts so that I wasn't trying the same thing repeatedly and everything is temporarily Rem'd
When I put the data back into the ListBox it doesn't show any commas or quotes and I don't know whether it should or not.
Can someone please tell me what I am doing wrong.
Private Sub cmdSave_Click()
Dim i As Integer
Open App.Path & "\List.txt" For Output As #1
'For i = 0 To List1.ListCount - 1
'Write #1, List1.List(i) 'this saves each line between one set of quotes
'Write #1, A(i), B(i), C(i) 'expected array error
'Print #1, List1.List(i) 'Prints the list without the quotes
'Write #1, List1.List(i) 'writes a full line between 2 quotes
'Next
'Print #1, A, B, C 'prints one line with large spaces without quotes
'Write #1, A, B, C 'this just writes the last line of the list
'Do Until EOF(1)
'Print #1, List1.Text 'prints nothing
'Write #1, List1 'Just prints quotes with no data
'Print #1, List1 'prints nothing
'Loop
Close #1
End Sub