Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default filling a two column listbox from a two column recordset

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default filling a two column listbox from a two column recordset

http://support.microsoft.com/default...61&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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default filling a two column listbox from a two column recordset

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



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default filling a two column listbox from a two column recordset

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



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
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


.







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default filling a two column listbox from a two column recordset

Tom,

Thank you very much for helping me. I got it to work
before your last note. I really do appreciate your quick
response - sorry I'm late getting back.

Dennis

-----Original Message-----
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


.





.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
filling a column Mary M. New Users to Excel 6 August 19th 09 06:52 PM
how to change column references, while filling down another column bclancy12 Excel Discussion (Misc queries) 1 June 7th 06 04:13 PM
Pre-filling column wnfisba Excel Discussion (Misc queries) 1 September 1st 05 10:35 PM
How to populate a multi-column activeX listbox on a spreadsheet with an ADO recordset quartz Excel Programming 1 May 3rd 04 10:13 PM
Filling Column with Numbers Tom Ogilvy Excel Programming 2 August 31st 03 06:51 PM


All times are GMT +1. The time now is 07:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"