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!

it is possible to select several rows from a combobox

Status
Not open for further replies.

titoneon

MIS
Dec 11, 2009
335
US
Hi Guys
I would like to have the ability to select several rows from a combobox, no necessary has to be next row, once i have selected them, i can pass these values and run a report based on those values.

It is possible to add that functionality to it ?
or
can i add a check box to a combobox and whatever is cheked, will be the filter condition for running a report ?

I don't want to use a Grid since the records or row listed will be a few
Thanks
 
Comboboxes are a combination of a textbox and a list. Their purpose in life is to store a single value (the user's selection) from the list into the textbox portion of the control. So, no, multi-select would be contrary to the purpose of the control.

And as a user, I think it would confuse the heck out of me. I know a combobox when I see it and I know how it works. I know what it does. I'm not sure I'd ever feel comfortable with a combo that attempts multiple selections.
 
IF you want to experiment, you can create your own combo, since Mr. danfreeman already gave you the starting point.
For example Place in a container a textbox, a listbox and a command button and set the listboxes's multiselect property.

Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
As the others have said, the basic answer to your question is No - you can't do a multi-select in a combo box.

However, we recently discussed several alternative solutions to this problem. See thread184-1731941.

Also, just because you have a small number of rows, that's no reason not to use a grid.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
A Listbox with multiselect=.t. would fit the purpose. If there's no place for that on your form, do a separate form you call or expand and collapse a listbox via a button, so the user can select or view selected items when in expanded mode.

Bye, Olaf.
 
One other thought on using a combo box for multiselect.

When you make a selection in a combo box, the list closes leaving the selection in the text box portion. If it's multiselect, how does the user close it once they've made all their selections? Or are they expected to open it repeatedly to make each of their selections? That could get cumbersome. If each selection adds to the selection, how do they deselect?

It seems like a lot of effort to invent something new that nobody will know how to use.
 
Yes, dan, that's also right, but an expanding listbox could stay expanded for multiple selections until you click a expand/collapse button. If it's about sparse place in a form, that could solve it as a popup form could, too.

Of course that too would be something you need to learn to use, but it's more like a popup form started via a button, quite normal. If you put the expand/collapse or open/close at the upper right corner it looks like a popup form. Anyway, such a filled form is against some unwritten UI and UX rules to rather have much space as resting place for the eye. A little Zen or Feng Shui thoughts, no matter how you think about esotherical things, is nicer for users in terms of stress due to information floods. Though users (or their manager) mostly order forms crammed with all the data and buttons to do something in one place.

Well, maybe off topic, as we don't know the reasoning. If there is enogh space on the form in question put a listbox in there and you're done, or as mike suggested, use a grid to even have more options about the layout and coloring or other highlighting of selected items.

If you don't want to have the filter options in permanent view, and they seldom change, they could even be put into a user options form, maybe a tab for each report you filter.

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top