List box -newbie question

List box -newbie question

Post by gianni » Sat, 20 Sep 2003 02:34:43



have a project with an ADO DataControl.
I need place (in the form) a list box that show
(in group) the records of one field**.
How can build this list box ?
I know well access but it is more easy.
I am newbie in VB and i want someone
indicate me the way that make this list box.

**I tried byself and i placed a list box in the form
and i set in DataSourse = adodc1 and in
DataField = <the field> but when i run the project
i dont see nothing in the list box.
 
 
 

List box -newbie question

Post by Bernard Ki » Sat, 20 Sep 2003 06:47:06

I think you need to use unbound control on list box. Open
the recordset, then use do loop.
do
listbox.additems recordset!fieldname
recordset.movenext
loop until recordset.eof
good luck.

 
 
 

List box -newbie question

Post by Val Mazu » Sat, 20 Sep 2003 11:19:47

Hi,

Since you just started with VB I would suggest to get rid off bound controls
at all and try to work with ADO directly. I think in your case recordset was
opened on a server-side, which may lead to situation when you do not see
recordset. try to open it on client side setting CursorLocation property of
it to adUseClient


--
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.yqcomputer.com/
 
 
 

List box -newbie question

Post by gianni » Sat, 20 Sep 2003 13:07:07

What is the listbox ?
what is the additems ?
 
 
 

List box -newbie question

Post by gianni » Sat, 20 Sep 2003 13:07:22

How can do this ?



try to open it on client side setting CursorLocation property of
it to adUseClient
 
 
 

List box -newbie question

Post by gianni » Sat, 20 Sep 2003 13:07:34

How can do this ?



try to open it on client side setting CursorLocation property of
it to adUseClient
 
 
 

List box -newbie question

Post by gianni » Sat, 20 Sep 2003 13:29:32

How can do this ?



try to open it on client side setting CursorLocation property of
it to adUseClient
 
 
 

List box -newbie question

Post by Val Mazu » Mon, 22 Sep 2003 05:22:55

Hi,

When you have recordset, then you set property of it like

MyADORecordset.CursorLocation=adUseClient

--
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.yqcomputer.com/