Valhalla Legends Forums Archive | General Programming | Using Inputbox to retrieve Data saved in a .txt

AuthorMessageTime
Crypticflare
[code]Private Sub mnuOpen_Click()
Dim PrgName As String
Dim Username As String
Dim Passwrd As String

Open (App.Path & "\Data\" & txtProg.Text & ".txt") For Input As #1
Input #1, strblank
Input #1, PrgName
txtProg.Text = PrgName
Input #1, strblank
Input #1, Username
txtUsername.Text = Username
Input #1, strblank
Input #1, Passwrd
txtPW.Text = Passwrd

End Sub
[/code]

Now to retrieve the txt file I type in the prog name in the txtbox and click open file, but i'd like to use a inputbox instead of having to use that. I would appreciate any help with it.
January 25, 2003, 7:46 PM
Noodlez
[code]Private Sub mnuOpen_Click()
Dim PrgName As String
Dim Username As String
Dim Passwrd As String
Dim FileName as String
FileName = InputBox("Please enter the path to the file to open","Open File",App.Path & "\Data\")
Open (FileName) For Input As #1
Input #1, strblank
Input #1, PrgName
txtProg.Text = PrgName
Input #1, strblank
Input #1, Username
txtUsername.Text = Username
Input #1, strblank
Input #1, Passwrd
txtPW.Text = Passwrd

End Sub
[/code]
January 25, 2003, 11:40 PM
Crypticflare
Wow, I never thought of that, thanks a lot Noodlez
January 26, 2003, 10:05 AM

Search