View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default filling a two column listbox from a two column recordset

Left out the End With

Do Until rstEmployees.EOF
with UserForm1
.ComboBox1.AddItem rstEmployees!lName
.Combobox1.List(.combobox1.Listcount-1,1) = rstEmployees!fName
End with

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Do Until rstEmployees.EOF
with UserForm1
.ComboBox1.AddItem rstEmployees!lName
.Combobox1.List(.combobox1.Listcount-1,1) = rstEmployees!fName

' To use a ListBox control, use the following statement instead
' of the one above:
' UserForm1.ListBox1.AddItem rstEmployees!lName
'
' If the ComboBox or ListBox is on a worksheet instead of
' a UserForm, reference the worksheet instead of the UserForm:
' ActiveSheet.ComboBox1.AddItem rstEmployees!lName
rstEmployees.MoveNext
Loop

--
Regards,
Tom Ogilvy



"Dennis" wrote in message
...
Tom,

Thank you. However, I'm having trouble with filling the
second column. My two fields fill in the first column.

Any ideas?

Dennis

-----Original Message-----
http://support.microsoft.com/default.aspx?scid=kb;en-

us;244761&Product=xlw
XL2000: How to Use ADO to Return Data to a ListBox or

ComboBox

--
Regards,
Tom Ogilvy

"Dennis" wrote in message
...
Is there a way to fill a two column listbox on a

userform
from a SQL recordset? I want the user to be able to

make
multiple selections from this listbox. And then I want

to
write an update SQL back to a table.

Thank you in advance, Dennis


.