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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set a 2 column combobox default value

Status
Not open for further replies.

RWWAMS

Technical User
Jan 3, 2003
104
US
Hi everyone,

I've got a two column combo box on an excel form. It displays an employee id and employee name. When the form is activated I'm successfully populating the combo box. I also want to set the default value, but cannot figure out the syntax. This sounds like it should be simple (I'm sure it is), but I'm not familiar with the properties that are used with a two column combobox. All I want to do is set the value of the combo box and display both the first employee id and name. I can only get the employee id to populate.

Thanks
 
I already had that property set to two.

Any other ideas?
 
I'm not using the RowSource property for anything. If I try to enter a value for that property, I receive a VB error "Could not set the RowSource property. Invalid property value."

???
 
Hi Skip, thanks for your patience.

I've tried to set it using combinations of the list, listindex and value properties. But to no avail. I'm not too familiar with these properties so I'm just guessing. And apparently I'm not a very good guesser.

The code I use to populate the combo box:
For I = 8 To EMP_COUNT + 8
cboEMPLOYEE.AddItem
cboEMPLOYEE.List(I - 8, 0) = Sheets("PROD. & QUAL. STATS").Cells(2).ROWS(I).Value
cboEMPLOYEE.List(I - 8, 1) = Sheets("PROD. & QUAL. STATS").Cells(3).ROWS(I).Value
Next I

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top