By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,078 Members | 1,317 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,078 IT Pros & Developers. It's quick & easy.

How do I evaluate if all or some of items in list box are selected

P: 7
I have form with a listbox "lstOperator(s)" which is populated by "tblOperators.OperatorName". At the top of the list I have added the option to "Select All". I have added a command button "cmdNext" to the form. If "Select All" is selected in "lstOperators", I want to preview a report "rptProduction" with no filtering when "Next" is clicked. If only some of "lstOperators" listings are selected, I want to go to another listbox "lstLeases" when "Next" is clicked. How do I code this please?
Feb 7 '08 #1
Share this Question
Share on Google+
1 Reply


Jim Doherty
Expert 100+
P: 897
I have form with a listbox "lstOperator(s)" which is populated by "tblOperators.OperatorName". At the top of the list I have added the option to "Select All". I have added a command button "cmdNext" to the form. If "Select All" is selected in "lstOperators", I want to preview a report "rptProduction" with no filtering when "Next" is clicked. If only some of "lstOperators" listings are selected, I want to go to another listbox "lstLeases" when "Next" is clicked. How do I code this please?
If I,ve read the description of your requirement properly your listbox contains the physical words "Select All" as part of the data under which then comes then a list of operators.

Personally I'd loop the listbox and select all of the operators in code by hitting a button and 'actually' selecting all of them in the list and base the logical action on that. It is the usual method or typical way one selects items in a listbox but I won't dwell on that in favour of your posted descriptive requirement

I've created a very simple attached zipped database of what I think you are meaning. Its not particularly efficient code but have done for clarity of understanding the logic involved given you are a relative newcomer to code you might expect that.

Regards

Jim :)
Attached Files
File Type: zip Wade.zip (17.1 KB, 77 views)
Feb 8 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.