I have been messing with the code a little more and noticed something. With my original code, the combo actually had a blank line for each line in the database field. It seems that the info is getting to the recordset, but the combo box is not displaying the actual text as it goes through each field.
To test this, I ran the following code:
Private Sub Form_Load()
cboStatus.AddItem ("temp 1")
DBconnectionSF.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\TS99_v101.mdb;Jet _
OLEDB:Database Password=work"
StatusSFrset.Open "SELECT ([Status]) FROM [Selection_Fields] _
ORDER BY Status ASC", DBconnectionSF, adOpenForwardOnly, _
adLockReadOnly
With StatusSFrset
Do While Not .EOF
cboStatus.AddItem (Status)
.MoveNext
Loop
End With
DBconnectionSF.Close
cboStatus.AddItem ("temp 2")
End Sub
The result of the combobox pulldown was as follows:
--------------
temp 1
temp 2
--------------
Without the code refering to the database, it looks as follows:
--------------
temp 1
temp 2
--------------
Hope this makes sense!
Tom
|