PC Review


Reply
Thread Tools Rate Thread

Adding a Value List to Combo Box

 
 
kirkm
Guest
Posts: n/a
 
      21st Feb 2007
I thought this would be easy!

My instructions are

Set the Row source Type property to Value List

0n the Data tab of the property sheet,
click .... to open the Edit List Items
dialog box, and then type the items on
separate lnes.

However I have no such Selection available in RowSource.

Another instruction says


The combo and list box controls allow you to enter a list of items.
When you choose this route, you enter in the control's Row Source
property a setting in the form of

"item1";"item2";"item3"

But if I enter that into RowSource, Excel tells me

Could not set the RowSource property. Invalid property value.

Very frustrating! Anyone know why this isn't working?

Thanks - Kirk
 
Reply With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      21st Feb 2007
where are you getting these instructions. Are they for Excel. I don't use
Access, but it seems It is possible in Access (although I believe the
correct way is a combination of the two ways you describe) - anyway to the
best of my knowledge it isn't possible in Excel for a listbox/combobox from
the control toolbox toolbar.

In excel, you can use additem to add items to a listbox or combobox at
runtime or assign the rowsource/listfillrange property to a range either
using the properties window or at runtime.

In excel, you can type in a comma separated list when using the the list
option under Data =>Validation (method #2). This is a form of combobox.



--
Regards,
Tom Ogilvy

"kirkm" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I thought this would be easy!
>
> My instructions are
>
> Set the Row source Type property to Value List
>
> 0n the Data tab of the property sheet,
> click .... to open the Edit List Items
> dialog box, and then type the items on
> separate lnes.
>
> However I have no such Selection available in RowSource.
>
> Another instruction says
>
>
> The combo and list box controls allow you to enter a list of items.
> When you choose this route, you enter in the control's Row Source
> property a setting in the form of
>
> "item1";"item2";"item3"
>
> But if I enter that into RowSource, Excel tells me
>
> Could not set the RowSource property. Invalid property value.
>
> Very frustrating! Anyone know why this isn't working?
>
> Thanks - Kirk



 
Reply With Quote
 
kirkm
Guest
Posts: n/a
 
      21st Feb 2007
On Tue, 20 Feb 2007 23:00:24 -0500, "Tom Ogilvy" <(E-Mail Removed)>
wrote:

>where are you getting these instructions.


Mainly from hours of Googling around and being sent up many garden
paths

> Are they for Excel.


So it says. I don't know, and I can't make it work.

>I don't use
>Access, but it seems It is possible in Access (although I believe the
>correct way is a combination of the two ways you describe) - anyway to the
>best of my knowledge it isn't possible in Excel for a listbox/combobox from
>the control toolbox toolbar.


I've lost you there. Caqn I rephrase the question ?

Can you have a list or combo box displaying e.g. three choices,
Info1, Info2, Info3. The words 'Info1" etc aren't in a cell on a
sheet but are hard wired (constants ?)

>In excel, you can use additem to add items to a listbox or combobox at
>runtime or assign the rowsource/listfillrange property to a range either
>using the properties window or at runtime.


I'll search more for AddItem. May fluke a decent example.
>
>In excel, you can type in a comma separated list when using the the list
>option under Data =>Validation (method #2). This is a form of combobox.


I don't follow, sorry. I've only these choices under Data

Data
BoundColumn
ColumnCount
ColumnHeads
ColumnWidths
ControlSource
ListStyle
RowSource
Text
TextColumn
TopIndex


Thanks - Kirk
 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      21st Feb 2007
No, you can't use this approach in Excel - is that clearer.

This is what you can do:

Private Sub Userform_Initialize()
Listbox1.Rowsource = ""
Me.Listbox1.AddItem "Info1"
Me.Listbox1.AddItem "Info2"
Me.Listbox1.AddItem "Info3"
End sub

>In excel, you can type in a comma separated list when using the the list
>option under Data =>Validation (method #2). This is a form of combobox.

This suggestion was a possible alternative to whatever you are trying to
achieve which does not use the type of combobox you are trying to use.
disregard it an place all your energy in using AddItem.

--
Regards,
Tom Ogilvy



"kirkm" wrote:

> On Tue, 20 Feb 2007 23:00:24 -0500, "Tom Ogilvy" <(E-Mail Removed)>
> wrote:
>
> >where are you getting these instructions.

>
> Mainly from hours of Googling around and being sent up many garden
> paths
>
> > Are they for Excel.

>
> So it says. I don't know, and I can't make it work.
>
> >I don't use
> >Access, but it seems It is possible in Access (although I believe the
> >correct way is a combination of the two ways you describe) - anyway to the
> >best of my knowledge it isn't possible in Excel for a listbox/combobox from
> >the control toolbox toolbar.

>
> I've lost you there. Caqn I rephrase the question ?
>
> Can you have a list or combo box displaying e.g. three choices,
> Info1, Info2, Info3. The words 'Info1" etc aren't in a cell on a
> sheet but are hard wired (constants ?)
>
> >In excel, you can use additem to add items to a listbox or combobox at
> >runtime or assign the rowsource/listfillrange property to a range either
> >using the properties window or at runtime.

>
> I'll search more for AddItem. May fluke a decent example.
> >
> >In excel, you can type in a comma separated list when using the the list
> >option under Data =>Validation (method #2). This is a form of combobox.

>
> I don't follow, sorry. I've only these choices under Data
>
> Data
> BoundColumn
> ColumnCount
> ColumnHeads
> ColumnWidths
> ControlSource
> ListStyle
> RowSource
> Text
> TextColumn
> TopIndex
>
>
> Thanks - Kirk
>

 
Reply With Quote
 
kirkm
Guest
Posts: n/a
 
      22nd Feb 2007
On Wed, 21 Feb 2007 05:59:55 -0800, Tom Ogilvy
<(E-Mail Removed)> wrote:

>No, you can't use this approach in Excel - is that clearer.


Yes, yes!! Something I stumbled over said I could.... and I
foolishly believed it!
>
>This is what you can do:
>
>Private Sub Userform_Initialize()
>Listbox1.Rowsource = ""
>Me.Listbox1.AddItem "Info1"
>Me.Listbox1.AddItem "Info2"
>Me.Listbox1.AddItem "Info3"
>End sub
>
>>In excel, you can type in a comma separated list when using the the list
>>option under Data =>Validation (method #2). This is a form of combobox.

>This suggestion was a possible alternative to whatever you are trying to
>achieve which does not use the type of combobox you are trying to use.
>disregard it an place all your energy in using AddItem.



Many thanks Tom, it all makes sense now. I succeeded with the AddItem
method, but then discovered a Hidden Form was possible and this
provided a storage means as well.

Cheers - Kirk
 
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
Re: Adding to a Combo Box list Stefan Hoffmann Microsoft Access Forms 0 4th Apr 2010 03:57 PM
Combo boxes, adding to list =?Utf-8?B?Sm8tQW5uZQ==?= Microsoft Access Form Coding 2 1st Feb 2005 01:05 AM
Adding item to list for combo box sammy Microsoft Access Form Coding 9 14th May 2004 05:38 AM
adding to a combo list Zygoid Microsoft Excel Misc 3 5th Feb 2004 01:17 AM
Re: Adding file list to list or combo control Michael Daly Microsoft Access Form Coding 0 2nd Sep 2003 07:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:57 AM.