Ok, I got this working to be able to delete the last line of the text file and it seems to be re-writing the text file properly. The only problem with it is that I cannot select a line, which is what I would really like to do. Here is my code:
Private Sub CommandButton2_Click()
ListBox1.RemoveItem (ListBox1.ListCount - 1)
MyFile2 = "c:\temp2\" & txtCCA & ".txt"
fnum2 = FreeFile()
Open MyFile2 For Output As fnum2:
For i = 0 To ListBox1.ListCount - 1
Print #fnum2, ListBox1.Column(0, i)
Next
Close #fnum2
Me.txtComments.Value = vbNullString
End Sub
Bookmarks