Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate combobox with custom column headers... 1

Status
Not open for further replies.

Webkins

Programmer
Dec 11, 2008
118
US
I have an Access combobox that contains 4 columns. I am using the following code to populate the combobox with data and is working fine:

responsible_pending.RowSource = ""
rs.MoveFirst
Do
responsible_pending.AddItem rs![work_order] & ";" & _by & ";" & status & ";" & technician
rs.MoveNext
Loop Until rs.EOF

Now I would like to add my own custom column headers to the 4 columns. Can someone help me with this please. Thank you in advance.
 

I would probably just put labels above the list box because, if the headings are IN the box, they would be selectable.
But, if you still want them there, can't you just do an AddItem before entering your Do Loop?


Randy
 
no need for all this

i don"t know where you set rs

but i would change the Sql of rs to include the custom heders

ie if the field name is [Work_order]
the sql should be select [Work_order] as [Work order] ..From tablename

just set ColumnHeads form the combo box to yes

and set me.responsible_pending.recordset = rs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top