Here is part A. (Loading the ComboBox)
VB Code:
Option Explicit Private Sub Form_Load() Dim strArrBuff() As String Dim intIdx As Integer On Error GoTo Err_Handler 'Open the text file and slit up each lin into a string array Open App.Path & "\myFile.txt" For Input As #1 strArrBuff = Split(Input(LOF(1), 1), vbCrLf) Close #1 'Iterate past each array element, and strip out the first part of the string For intIdx = 0 To UBound(strArrBuff) Combo1.AddItem Split(strArrBuff(intIdx), ";")(0) Next Combo1.ListIndex = 0 'Show the fist entry Exit Sub Err_Handler: MsgBox "Description: " & Err.Description & vbCrLf & _ "Number: " & Err.Number, vbOKOnly + vbInformation, "Error" End Sub
Bruce.




Reply With Quote