PDA

View Full Version : column headers



talytech
03-30-2012, 09:59 AM
I am trying to display column headers in a combo box that is on a UserForm called from a button. Is that possible?

Currently, I am able to add items to the drop down (combo box) but I can't get it to display the column headers. Here's what I have:

rstSpan.MoveFirst
I = 0
cboDirectory.ColumnWidths = "0 in;1 in;1 in;1 in;1 in;1 in"
cboDirectory.ColumnHeads = True
Do While rstSpan.EOF = False
cboDirectory.AddItem
cboDirectory.List(I, 0) = (rstSpan.Fields("userID_hidden").Value)
cboDirectory.List(I, 1) = (rstSpan.Fields("Lname").Value)
cboDirectory.List(I, 2) = (rstSpan.Fields("Fname").Value)
cboDirectory.List(I, 3) = (rstSpan.Fields("userID").Value)
cboDirectory.List(I, 4) = (rstSpan.Fields("EmpID").Value)
cboDirectory.List(I, 5) = (rstSpan.Fields("Type").Value)

I = I + 1
rstSpan.MoveNext
Loop


Is there something I'm doing wrong?

fredlo2010
04-24-2012, 11:51 AM
Don't you have to Dim rstSpan as a variable? I am sorry I am a newbie as well. Good luck

fumei
04-24-2012, 09:05 PM
I await a good answer. I have never been able to do this either.

Tinbendr
04-25-2012, 04:03 AM
Is there something I'm doing wrong?No. It's a long time bug. Use labels over the combobox instead.