hello im really new to programming and im basically trying to create a program where an item number it entered and the program will find the item from a list of ten items i have stored in a .txt file. the problem is i dont know how to load them into vb. i then had the idea to try and load them into a combo box from looking at a different topic on the forum but still i have no look so any help is welcome.
CODE
Private Sub Command1_Click()
Dim combo1 As ComboBox
Call LoadSC_item1(combo1)
End Sub
Private Sub item_Change()
Dim iFile As Integer
Dim item1() As String
Dim iItem As Integer
iFile = FreeFile
Open "I:\stocklist.txt" For Input As iFile
item1 = Split(Input$(LOF(iFile), iFile), vbCrLf)
Close iFile
.Clear
For iItem = 0 To UBound(sCDKeys)
If Len(item1(iItem)) > 0 Then
.AddItem item1(iItem)
End If
Next
If .ListCount > 0 Then
.ListIndex = 0
End If
End With
End Sub
This post has been edited by mike_heim: 4 Dec, 2008 - 02:29 PM