I have a list box that is automatically populated when the form loads. When a user selects a name in the list box the name is displayed in a text box. The text box is set to multiline but no matter which carriage return code I use only one line is printed. Selection one is replaced by selection two, etc. Advice greatly appreciated.
Private Sub Form_Load()
Dim strAppliance As String
Open "C:\VB Projects\Appliance_List\Appl_Names.txt" For Input As #1
lstAppliances.Clear
Do Until EOF(1)
Input #1, strAppliance
With lstAppliances
.AddItem strAppliance
End With
Loop
Close #1
End Sub
Private Sub lstAppliances_Click()
If lstAppliances.ListIndex > -1 Then
txtOutput.Text = lstAppliances.List(lstAppliances.ListIndex) & vbNewLine
End If
End Sub
Private Sub Form_Load()
Dim strAppliance As String
Open "C:\VB Projects\Appliance_List\Appl_Names.txt" For Input As #1
lstAppliances.Clear
Do Until EOF(1)
Input #1, strAppliance
With lstAppliances
.AddItem strAppliance
End With
Loop
Close #1
End Sub
Private Sub lstAppliances_Click()
If lstAppliances.ListIndex > -1 Then
txtOutput.Text = lstAppliances.List(lstAppliances.ListIndex) & vbNewLine
End If
End Sub