Display from a listbox selection
i have used this code to display First Name from a .txt file to a Listbox
Private Sub cmdOpen_Click()
lstName.Clear
If txtFile.Text = "" Then
MsgBox "No filename entered", vbInformation, "Error!"
Else
Open txtFile.Text For Input As #1
Do While Not EOF(1)
Input #1, strFirstName, strLastName, strPhone, strDate
lstName.AddItem strFirstName
Loop
Close #1
End If
End Sub
Private Sub lstName_ItemCheck(Item As Integer)
...? ? ? ?...
End Sub
What I would like help to code is a:
1) return a msgbox if the filename entered does not exist when cmdOpen is clicked
2) when a string(FirstName) from the listbox display is selected the other data associated to that selection(LastName, Phone, DOB) is shown in corresponding label boxes
thanx in advance:D