Here is the run-down.
FileList1 is on a form named FileList.
I can open files from my file list box, and my common dialog, no problem. After I save a file I CAN NOT open a file from my listbox, but I can still open a file from my common dialog.
MyFile is delared as a Global String in a module.
Here is the code that is executed when a file is opened from the file list box.
Text1.Text = Filelist1.FileName
MyName = Text1.Text
Dim NewOpen As New frmOpenNote
NewOpen.Show
Form NewOpen handles the opening of the selected file (the file selected in FileList1) This is the code.
Me.TxtArea.LoadFile MyName
THIS CODE WORKS PERFECTLY UNTILL YOU SAVE A FILE. When you save a file (using commondialog1) and then you try to open a file using the FileList1, Run-Time error 75 occurs- The specified path/file name cannot be accessed or is invalid. When I click debug, the code that is hilighted is this: Me.TxtArea.LoadFile MyName
After you end the program, run it again, and try to open a file using filelist1, EVEN BEFORE A SAVE, VB returns that error, and the only way for that code to work again is to close VB, and open the project back up, and then it works, and it all starts again. By the way, I have compiled the program, and I ran it, if I save the same error occurs.
WHAT IS GOING ON HERE?!??!?
FileList1 is on a form named FileList.
I can open files from my file list box, and my common dialog, no problem. After I save a file I CAN NOT open a file from my listbox, but I can still open a file from my common dialog.
MyFile is delared as a Global String in a module.
Here is the code that is executed when a file is opened from the file list box.
Text1.Text = Filelist1.FileName
MyName = Text1.Text
Dim NewOpen As New frmOpenNote
NewOpen.Show
Form NewOpen handles the opening of the selected file (the file selected in FileList1) This is the code.
Me.TxtArea.LoadFile MyName
THIS CODE WORKS PERFECTLY UNTILL YOU SAVE A FILE. When you save a file (using commondialog1) and then you try to open a file using the FileList1, Run-Time error 75 occurs- The specified path/file name cannot be accessed or is invalid. When I click debug, the code that is hilighted is this: Me.TxtArea.LoadFile MyName
After you end the program, run it again, and try to open a file using filelist1, EVEN BEFORE A SAVE, VB returns that error, and the only way for that code to work again is to close VB, and open the project back up, and then it works, and it all starts again. By the way, I have compiled the program, and I ran it, if I save the same error occurs.
WHAT IS GOING ON HERE?!??!?