Hi
I need to list in a ImageCombo all entries from a RecordSet
I have the following:
...
Set cbo.DataSource = MyRs
cbo.DataField = "Designacao"
...
But with this code I only list the first entry and not all. Can you help?
Regards
Luis
Printable View
Hi
I need to list in a ImageCombo all entries from a RecordSet
I have the following:
...
Set cbo.DataSource = MyRs
cbo.DataField = "Designacao"
...
But with this code I only list the first entry and not all. Can you help?
Regards
Luis
Could you post more code? Are you sure there are more than one record that is returned by your recordset?
...
With MyRs
.CursorLocation = adUseServer
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open "SELECT Designacao FROM CtrlTipoTerminal", Conn
End With
While Not MyRs.EOF
straux = MyRs("Designacao")
cbo.ComboItems.Add , , straux
MyRs.MoveNext
Wend
...
with this code I can list all entries (at the moment 10) but if I use the following code it only lists the first one
With MyRs
.CursorLocation = adUseServer
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open "SELECT Designacao FROM CtrlTipoTerminal", Conn
End With
Set cbo.DataSource = MyRs
cbo.DataField = "Designacao"
Any ideas why this happens?
Regards
use + sign while filling the combo
like
rs!rollno + rs!name
If your code at the upper part works then why use the bottom part? Databound controls have their disadvantages too. ;) Take a look at my sig.
Thank you. Now I am just curious to find out why does not work.
What problems can I find with databound?
In the "Data Binding is Evil" link in my signature.