DebbieCoates
Programmer
Can anyone give me any idea as to why this isn't working, I just cant work it out and its driving me mad, or is there any other way to set a combo box?
is there a way to set the data source to somehow set to the cnn connection i have already set up, and then to the recordset?
Dim rsCountries As New ADODB.Recordset
rsCountries.Open sql, cnn, adOpenStatic, adLockReadOnly
With rsCountries
.MoveFirst
If Not .EOF Then
Do Until .EOF
CboCountries.AddItem rsCountries.Fields("Country")
.MoveNext
Loop
End If
End With
rsCountries.Close
Set rsCountries = Nothing
is there a way to set the data source to somehow set to the cnn connection i have already set up, and then to the recordset?
Dim rsCountries As New ADODB.Recordset
rsCountries.Open sql, cnn, adOpenStatic, adLockReadOnly
With rsCountries
.MoveFirst
If Not .EOF Then
Do Until .EOF
CboCountries.AddItem rsCountries.Fields("Country")
.MoveNext
Loop
End If
End With
rsCountries.Close
Set rsCountries = Nothing