|
-
Aug 3rd, 2005, 04:26 AM
#1
Thread Starter
Member
ImageCombo and DataSource [Resolved]
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
Last edited by Tugabargains; Aug 3rd, 2005 at 10:56 AM.
-
Aug 3rd, 2005, 04:31 AM
#2
Re: ImageCombo and DataSource
Could you post more code? Are you sure there are more than one record that is returned by your recordset?
-
Aug 3rd, 2005, 04:34 AM
#3
Thread Starter
Member
Re: ImageCombo and DataSource
...
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"
-
Aug 3rd, 2005, 04:56 AM
#4
Thread Starter
Member
Re: ImageCombo and DataSource
Any ideas why this happens?
Regards
-
Aug 3rd, 2005, 04:58 AM
#5
New Member
Re: ImageCombo and DataSource
use + sign while filling the combo
like
rs!rollno + rs!name
-
Aug 3rd, 2005, 05:04 AM
#6
Re: ImageCombo and DataSource
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.
-
Aug 3rd, 2005, 05:08 AM
#7
Thread Starter
Member
Re: ImageCombo and DataSource
Thank you. Now I am just curious to find out why does not work.
What problems can I find with databound?
-
Aug 3rd, 2005, 05:09 AM
#8
Re: ImageCombo and DataSource
In the "Data Binding is Evil" link in my signature.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|