Populating combo box with DB entries
Hi. Can anyone tell me whats wrong with this code??
VB Code:
Private Sub Form_Activate()
Dim stSQL As String
stSQL = "SELECT DISTINCT [Focus_Area_of_System] FROM [List_of_Current_Practices_SQE]"
With Adodc1
.CommandType = adCmdText
.RecordSource = stSQL
.Refresh
Do Until .Recordset.EOF
.Recordset.MoveNext
If .Recordset![Focus_Area_of_System] <> "" Then
cboFocus_Area_of_System.AddItem Adodc1.Recordset![Focus_Area_of_System]
End If
Loop
End With
End Sub
It keeps deleting entries from my DB and doesn't populate the combo box at all. I was using DAO with this code before and it worked ok but im changing to ADO and now i'm fetting errors everywhere. Any ideas?
Cheers, Triona :p