hi i have this code which retrive the information from file by write on text1 and the information show in text 2 and text 3 and text 4 Code: Private Sub Text1_Change() On Error Resume Next Dim f As String f = App.Path If Right(f, 1) <> "\" Then f = f + "\" f = f + Text1.Text Dim X, Y, z As String Open f For Input As #5 Input #5, X, Y, z Text2.Text = X Text3.Text = Y Text4.Text = z Close #5 End Sub how can i retrieve the information all files and show it in listbox
It depends what the user is entering in Text1 as the filename. You may as well use a CommonDialog control or DriveListBox, DirListBox and a FileListBox. You are also dimensioning your variables wrong. Just because you add As String at the end don't assume that they will all be Strings. Only z with be a string X and Y with be Variants Dim X As String, Y As String, z As String Do you want to use 1 ListBox or 3? Open f For Input As #5 Input #5, X, Y, z List1.AddItem X List2.AddItem Y List3.AddItem z Close #5 As a general rule when you add Strings f = f + Text1.Text you use f = f & Text1.Text Avoid using On Error Resume Next if an error occurs then you won't spot it. Just rem it out while you are testing. So which part isn't working as it should?