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

Multiselect Listbox Potential Error

Status
Not open for further replies.

zimmer9

Programmer
Jan 12, 2005
66
0
0
US
I have 2 listboxes on a form from which the user can make a selection of state codes. I have set up 2 radio buttons adjacent to the listboxes to allow the user to toggle between these 2 listboxes. One of the listboxes sits on top of the other (superimposed) because I wanted to have the listbox on top be a non-multiselect listbox. This listbox is used more frequently than the other. The listbox hidden underneath is a multiselect listbox.

The listbox on top allows the user to select groupings of state codes which are mutually exclusive. I set up the 1st item as the default selection for the top listbox named lstStates. Therefore, I never have to worry about the user not making a choice (deselecting all the items) from the listbox because you can't deselect an itme. They can only make an alternate selection from the default item.

I say this because after the user makes selection(s) from either listbox, the user can click on a command button to run a report which is based on the state codes selected from either listbox.

The listbox underneath named lstStatesInd, allows the user to select individual states and is multiselect.

A potential problem exists when the user makes his selections from the mulitselect listbox (the one underneath).

With this multiselect listbox, the user may choose to deselect all the items on this listbox. I chose not to set a default item for this multiselect listbox because the user may not want to choose the default item and he or she may forget to turn this item off if they scroll down the listbox to make alternate selections. Futhermore, the user may deselect an item that I could set up as the default selection.

My question is how should I handle the situation in which the user goes to the multiselect listbox and doesn't make a selection or intially makes selection(s) and then ultimately deselects all the items.

Bear in mind that I don't want to force the user to make a selection from the mulitselect listbox once they have toggled to it, if he/she decides to toggle back to the non-multiselect listbox to make a choic from there instead.

Do you have a suggestion as to how I should handle this potential problem in terms of error logic coding ? I have created a status bar in which I can send an error message to the user as well.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top