Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default combo box empty after using .AddItem

I have a button on an excel spreadsheet that calls a form to filter existing
records. I managed to get the form to open but the items inside the combo
box are empty. I can select any of the empty spaces and still get the
formulas to work right (I placed a MsgBox command after I select the item so
I know there is information back there I just cant see it.

Here is the code I'm using:

Private Sub UserForm_Initialize()
'Populate Combo

m_cbIndustry.AddItem Text = "Automotive"
m_cbIndustry.AddItem Text = "Health"
m_cbIndustry.AddItem Text = "Industrial Equipment"
m_cbIndustry.AddItem Text = "Retail"
m_cbIndustry.AddItem Text = "Travel Services"
m_cbIndustry.Text = "Automotive"

End Sub

the "Automotive" which is the default shows up fine, the others are blank.
Any ideas how to fix this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default combo box empty after using .AddItem


Try this:
(remove the Text= portion of the additem)

Private Sub UserForm_Initialize()
'Populate Combo

m_cbIndustry.AddItem "Automotive"
m_cbIndustry.AddItem "Health"
m_cbIndustry.AddItem "Industrial Equipment"
m_cbIndustry.AddItem "Retail"
m_cbIndustry.AddItem "Travel Services"
m_cbIndustry.Text = "Automotive"

End Sub


Patricia Martinez Wrote:
I have a button on an excel spreadsheet that calls a form to filter
existing
records. I managed to get the form to open but the items inside the
combo
box are empty. I can select any of the empty spaces and still get the
formulas to work right (I placed a MsgBox command after I select the
item so
I know there is information back there I just cant see it.

Here is the code I'm using:

Private Sub UserForm_Initialize()
'Populate Combo

m_cbIndustry.AddItem Text = "Automotive"
m_cbIndustry.AddItem Text = "Health"
m_cbIndustry.AddItem Text = "Industrial Equipment"
m_cbIndustry.AddItem Text = "Retail"
m_cbIndustry.AddItem Text = "Travel Services"
m_cbIndustry.Text = "Automotive"

End Sub

the "Automotive" which is the default shows up fine, the others are
blank.
Any ideas how to fix this?



--
crispbd
------------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...o&userid=10880
View this thread: http://www.excelforum.com/showthread...hreadid=276588

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default combo box empty after using .AddItem

I already tried that and the combo box is still blank, any other ideas I
might be able to try?

"crispbd" wrote:


Try this:
(remove the Text= portion of the additem)

Private Sub UserForm_Initialize()
'Populate Combo

m_cbIndustry.AddItem "Automotive"
m_cbIndustry.AddItem "Health"
m_cbIndustry.AddItem "Industrial Equipment"
m_cbIndustry.AddItem "Retail"
m_cbIndustry.AddItem "Travel Services"
m_cbIndustry.Text = "Automotive"

End Sub


Patricia Martinez Wrote:
I have a button on an excel spreadsheet that calls a form to filter
existing
records. I managed to get the form to open but the items inside the
combo
box are empty. I can select any of the empty spaces and still get the
formulas to work right (I placed a MsgBox command after I select the
item so
I know there is information back there I just cant see it.

Here is the code I'm using:

Private Sub UserForm_Initialize()
'Populate Combo

m_cbIndustry.AddItem Text = "Automotive"
m_cbIndustry.AddItem Text = "Health"
m_cbIndustry.AddItem Text = "Industrial Equipment"
m_cbIndustry.AddItem Text = "Retail"
m_cbIndustry.AddItem Text = "Travel Services"
m_cbIndustry.Text = "Automotive"

End Sub

the "Automotive" which is the default shows up fine, the others are
blank.
Any ideas how to fix this?



--
crispbd
------------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...o&userid=10880
View this thread: http://www.excelforum.com/showthread...hreadid=276588


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default combo box empty after using .AddItem


I tried both your code and that which I supplied in the last message
The second worked. You might want to check to make sure the combo bo
you are trying to write to is in fact the one that is showing up on th
form

--
crispb
-----------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...fo&userid=1088
View this thread: http://www.excelforum.com/showthread.php?threadid=27658

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default combo box empty after using .AddItem

I deleted the whole thing and re-created it again and still the same problem.
Is there a setting I might be missing that causes them not to show up? Can
it be that the font is while or something?

"crispbd" wrote:


I tried both your code and that which I supplied in the last message.
The second worked. You might want to check to make sure the combo box
you are trying to write to is in fact the one that is showing up on the
form.


--
crispbd
------------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...o&userid=10880
View this thread: http://www.excelforum.com/showthread...hreadid=276588


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
Real quick: AddItem with combo boxes? AVERAGE(user) New Users to Excel 3 October 29th 05 10:13 AM
combobox additem masterphilch Excel Programming 2 October 25th 04 11:04 PM
AddItem Method Todd Huttenstine Excel Programming 3 April 21st 04 03:53 PM
.additem Robert Couchman[_4_] Excel Programming 3 February 20th 04 02:47 PM
Combo Box addItem question strataguru[_9_] Excel Programming 1 November 4th 03 10:11 PM


All times are GMT +1. The time now is 11:58 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"