PC Review


Reply
Thread Tools Rate Thread

Adding items to a combo box

 
 
Phrank
Guest
Posts: n/a
 
      3rd Dec 2006
Hello,

I've got a combo box on a form, and I'm trying to add items to it;
however, the items are not showing up - I believe I'm missing a step.
I've got the following in the code for the combo box right now:

Private Sub cbWhatToProcess_Change()
cbWhatToProcess.AddItem "Draft"
cbWhatToProcess.AddItem "Final"
cbWhatToProcess.AddItem "Other"
cbWhatToProcess.AddItem "Signature Pages"
cbWhatToProcess.AddItem "Regular PDF"
cbWhatToProcess.AddItem "Special PDF"
cbWhatToProcess.AddItem "Colored Graphs"

End Sub

I also want to be able to select multiple items from the list, so is
there anything special I need to do in order to do that? Thanks.

Frank
 
Reply With Quote
 
 
 
 
Mark Ivey
Guest
Posts: n/a
 
      3rd Dec 2006
I am unsure of how to select more than one item from the list at a time...


But to fix your first problem... you need to encase your code into a module
the will run when the userform initializes.

Private Sub UserForm_Initialize()
cbWhatToProcess.AddItem "Draft"
cbWhatToProcess.AddItem "Final"
cbWhatToProcess.AddItem "Other"
cbWhatToProcess.AddItem "Signature Pages"
cbWhatToProcess.AddItem "Regular PDF"
cbWhatToProcess.AddItem "Special PDF"
cbWhatToProcess.AddItem "Colored Graphs"
End Sub

"Phrank" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I've got a combo box on a form, and I'm trying to add items to it;
> however, the items are not showing up - I believe I'm missing a step.
> I've got the following in the code for the combo box right now:
>
> Private Sub cbWhatToProcess_Change()
> cbWhatToProcess.AddItem "Draft"
> cbWhatToProcess.AddItem "Final"
> cbWhatToProcess.AddItem "Other"
> cbWhatToProcess.AddItem "Signature Pages"
> cbWhatToProcess.AddItem "Regular PDF"
> cbWhatToProcess.AddItem "Special PDF"
> cbWhatToProcess.AddItem "Colored Graphs"
>
> End Sub
>
> I also want to be able to select multiple items from the list, so is
> there anything special I need to do in order to do that? Thanks.
>
> Frank



 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      3rd Dec 2006
If you want multiple selections, then using a combobox would be the wrong
control. Use a listbox instead.

I would say don't use the Change event to populate the Combobox. If you
look at the events of the userform, there are the Initialize events and the
Activate event which might be a more useful place to populate the Combobox.

--
Regards,
Tom Ogilvy

"Phrank" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I've got a combo box on a form, and I'm trying to add items to it;
> however, the items are not showing up - I believe I'm missing a step.
> I've got the following in the code for the combo box right now:
>
> Private Sub cbWhatToProcess_Change()
> cbWhatToProcess.AddItem "Draft"
> cbWhatToProcess.AddItem "Final"
> cbWhatToProcess.AddItem "Other"
> cbWhatToProcess.AddItem "Signature Pages"
> cbWhatToProcess.AddItem "Regular PDF"
> cbWhatToProcess.AddItem "Special PDF"
> cbWhatToProcess.AddItem "Colored Graphs"
>
> End Sub
>
> I also want to be able to select multiple items from the list, so is
> there anything special I need to do in order to do that? Thanks.
>
> Frank



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding New items to a combo box on the Fly. =?Utf-8?B?TGVsZQ==?= Microsoft Access 4 9th Sep 2006 03:00 PM
Adding Items To a combo Box LoveCandle Microsoft Excel Programming 4 7th Apr 2006 09:58 PM
Adding items to a combo box =?Utf-8?B?VFM=?= Microsoft VB .NET 6 8th Dec 2005 08:05 AM
Adding items in Combo box Bala Nagarajan Microsoft Dot NET Framework Forms 5 7th Nov 2005 08:29 AM
Adding Combo Box Items =?Utf-8?B?dmI=?= Microsoft VB .NET 3 13th Nov 2004 10:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:33 AM.