Private Sub UserForm_Initialize()
Dim adoRS As ADODB.Recordset, adoCN As ADODB.Connection
Dim strSQL As String
'Open connection to an Access database
Set adoCN = New ADODB.Connection
adoCN.Provider = "Microsoft.Jet.OLEDB.4.0"
adoCN.ConnectionString = "H:\temp\db1.mdb"
adoCN.Open
'Open a recordset
strSQL = "SELECT DISTINCT MPCUnit FROM FTEData;"
Set adoRS = New ADODB.Recordset
adoRS.Open strSQL, adoCN, adOpenForwardOnly, adLockReadOnly
'Now populate the combobox
With Me.ComboBox1
.Clear
While Not adoRS.EOF
.AddItem adoRS.Fields(0).Value
adoRS.MoveNext
Wend
End With
'Close recordset, connection objects and clean up
adoRS.Close
adoCN.Close
Set adoRS = Nothing
Set adoCN = Nothing
End Sub