Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have added a multi-column ListBox to a user form and need to fill it with data using VBA/ADO the data is retrieved into a recordset from SQL Server using this statement: rst.open "select Id, Name, Address1 from Customers where name like 'abc%'", oconn I am looking for something like lstCustomers.rowsource = rst, which does not work here Thanks in advance for your suggestions. Regards Habib |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I filled the contents of the recordset into range and used
Me.lstCustomers.RowSource = ("A26:B" & 26 + rs.RecordCount) My listbox now has data. However, I do not see all the columns, the columns are too wide Me.lstCustomers.RowSource = ("A26:B" & 26 + rs.RecordCount) Me.lstCustomers.ColumnCount = 12 Me.lstCustomers.ColumnWidths = "60 pt;72 pt;72 pt;72 pt;72 pt;36 pt;36 pt;36 pt;36 pt;36 pt;36 pt; 36 pt" Me.lstCustomers.Width = 600 wht am I doing wrong? -- www.DynExtra.com A resource for the Microsoft Dynamics Community Featuring FAQs, File Exchange and more Current member count: 40 -------------------------------------------- Share your knowledge. Add your favorite questions and answers Help add questions to this site! We want Your input. -------------------------------------------- "HSalim[MVP]" wrote in message ... Hi, I have added a multi-column ListBox to a user form and need to fill it with data using VBA/ADO the data is retrieved into a recordset from SQL Server using this statement: rst.open "select Id, Name, Address1 from Customers where name like 'abc%'", oconn I am looking for something like lstCustomers.rowsource = rst, which does not work here Thanks in advance for your suggestions. Regards Habib |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Filling a listbox whith recordset data | Excel Programming | |||
filling userform listbox | Excel Programming | |||
Filling a listbox with transpose of a range from an excel sheet | Excel Programming | |||
Problem with Find filling a listbox vba | Excel Programming | |||
Filling a listbox depending on font index | Excel Programming |