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

More Elegant Listbox 2

Status
Not open for further replies.

dgriffin

Programmer
May 26, 2001
50
US
I've searched through countless threads about populating a text field with selections from a multiselect listbox. And now that I understand that I can't do it with a combobox, how does one go about doing it with elegance?

It appears to me that the only way to accomplish it is to display the textbox that contains the result along with the listbox that contains the selections. But users find the duplicated info a bit confusing. They are complaining about not being able to type info into the textbox (aurgh!).

Furthermore, the form I refer to is employment application data. As you well know, this encompasses a lot of information. Which was originally broken up into logical sections that the user decided they wanted all on the same screen. And what the user wants the user gets. So, I have a form that is very crowded.

Having explained all that, the only "elegant" solution I can think of is to put the listbox in a popup. called be a button next to the result field.

Does anyone have a better idea? Is my deductive reasoning that Access doesn't provide a means of multiselecting a combobox correct? (logically I don't think it could even work) Or is there an altogether better way to approach it?

Any suggestions would be greatly appreciated.

Dan

P.S. I know that concatenating numerous data into one field is against the rules of normalization. However, as with many other real-life situations, sometimes the rules have to be bent.
 
What sort of information are you storing in this field? Just because you are displaying and allowing the user to edit a "multi-valued textbox", that doesn't mean to have to store it as a multi-valued field.

How are you separating (delimiting) 'values' within the multi-valued textbox e.g. using a comma, or semi-colon or space? You could allow the used to edit the textbox and validate the textbox on the after update event - and store the 'values' as a one-to-many relationship. I cant say I have ever tried this! I'm not sure if it is a sensible idea, but its a possible one.

Or, you could have the listbox as hidden such that i becomes visible when the user selects the textbox (ie behaves like a combo box) and becomes invisible when it loses focus.

Cheers,
Dan
 
Let's take a step back. Forget about text boxes, list boxes and all those other implementation details, and could you simply explain, in simple functional terms, what you want to do?

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
The form contains all of the information about an employment applicant, including certifications and past history with the prospective employer. The applicants are part time, most returning for the fourth or fifth year. Hence, the form has a hugh amount of data on it. Far more than one would desire, but that is the way the client wants it.

The field in question contains the positions to which the applicant is applying for, whether they are currently certified or not. The number of positions has increased from 5 to 8 over the Past 5 years. Therefore, the positions were placed in a table.

In the past, the client simply entered the single position that the applicant was most qualified for into this field (as a combobox).

Now the client wants to enter each of the positions that the applicant is applying for in that field (one text field). Therein lies the need to have the field utilize a combobox (not) or listbox to select multiple positions to be stored in a single text field. This is not the problem though. I know how to accomplish this technically, thanks to the gracious progammers on this site.

The problem is trying to implement this task elegantly. The most elegant of which would be to have a multiselect combobox. Although I doubt this would even be logically possible. So we are left with utilizing a text box (for the result to be stored in the table) and a listbox to provide the multiselect feature.

Since the existing form is overcrowded already, the most elegant way to empliment this, that I can think of, is to put the listbox in a popup. But I'm not entirely thrilled about that approach either.

I am sure there are possibilities that I haven't even dreamed of. And it is evident that there are a lot of tallented programmers on this site. So I posed the question "is there a better way". Short of altering the existing table structures. There are several application modules (payroll, staffing, attendance) that would be effected.

I appreciate your time and tallent.

Dan
 
-----------------------------
It appears to me that the only way to accomplish it is to display the textbox that contains the result along with the listbox that contains the selections. But users find the duplicated info a bit confusing. They are complaining about not being able to type info into the textbox (aurgh!).
-----------------------------
Can you not simply hide this text box, so the user does not see it?
Code:
.visible = false

that way, you can do what you are doing with the result and not have to change the code/forms etc much more (even though it may be over the top) but works?


Aubs
 
If I understand you correctly, create a "visual equivalant" of a multiselect combobox?

That is, hide the listbox starting at the vertical level of the textbox that contains the result, downward over the top of other fields that lay below the textbox. Making it visable only when the user enters the text box (just like an auto dropdown combobox) for them to make thier selection, etc, etc.

I like it. The only lingering detail would be how to logically go about exiting the listbox. Does a listbox terminate with a tab keystroke? Just like a combobox?

I think this will do the trick. I'll let you know.

Thanks.
 
You lost me there!!! lol! Think it's bed time!

Hope you have some luck

Regards,



Aubs
 
Thanks guys. I knew I came to the right place to resolve this.

The suggestion to use a hidden listbox lead me to a VERY elegant solution. In essence, it appears and feels like a combobox with the ability to multiselect items from the list.

It took a bit of code using the OnKeyPress event to trap tabs and enters to contol the appearance (faked dropdown) and disappearance of the list, but worked out really well.

It doesn't take up any more realestate than a combobox (in fact a little less because it doesn't have the dropdown button on the end of the field) and you don't have the confusion of 2 "boxes" on the screen addressing 1 input.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top