Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-22-2007, 01:39 AM
eyg eyg is offline
Registered User
 
Join Date: Jul 2007
Posts: 2
eyg is on a distinguished road
Question Select all in combo box

Hi,
I have a combo box which shows a list of data to report on - but there are times when I want to select all the data to report back on.
How do I get the word all into the combo list to return all the information onto my report.
Reply With Quote
Sponsored Links
  #2  
Old 07-22-2007, 03:54 AM
Luddite Lad's Avatar
Luddite Lad Luddite Lad is offline
Registered User
 
Join Date: Aug 2005
Posts: 177
Luddite Lad is on a distinguished road
Have you considered a multi-select ListBox?
__________________
The Luddite Credo:
If you don’t understand how it works, hit it with a hammer, and hit it hard.
Reply With Quote
  #3  
Old 07-22-2007, 03:59 AM
Tim L's Avatar
Tim L Tim L is offline
Registered User
 
Join Date: Sep 2002
Location: England, UK
Posts: 406
Tim L is on a distinguished road
Send a message via Yahoo to Tim L
Hmm,

You should be able to achieve something like what you describe, but it will, I think, require a fair bit of work.

First off you want to get 'All' as one of the options in the row source for the combo box. Whether you already have a query or not, for the row source, you are probably going to need one now as the tone of your message suggests that you have not entered a list of data for the combo box (if you had then I figure you wouldn't be asking the question) which suggests that the list will need to be dynamic, rather than fixed.

You will need to either:
  • Create a JOIN query that adds a single additional record to your current row source, so that this is listed with the original list. How you ensure that 'All' is at the top of the list (perhaps the most sensible place) or even at the bottom (an alternative to the top) is up to you and dependent on what you want to acheive, Or,
  • Add an additional record to the table that the row source is based on (even if there is a intermediate query, or two) but this could cause problems elsewhere (like places you do not want 'All' to appear).
Even after you have done this your work is not complete as you will probably need to add code to your form to handle the selection of 'All', you won't just be able to select 'All' from the drop-down box and let the underlying query handle. I say, probably, because if you are using the drop-down to select an item which is related to an SQL query (not shown) in the row source of the drop-down and you are using this SQL as the basis of the record source for the report, then your work may be done, but somehow I doubt it.

You will need to consider creating an addtional query to handle the 'All' situation, which you could instigate when the user requests the report (I presume that the request is formally made by clicking a command button or on the 'after update' event of the combo). It might, however, be less complicated to request 'All' from a separate button than building the 'All' option into the combo box drop-down (although I do think that building the option into the combo is the neater solution, from the users perspective).

HTH

Tim
Reply With Quote
  #4  
Old 07-22-2007, 05:44 AM
missinglinq's Avatar
missinglinq missinglinq is offline
AWF VIP
 
Join Date: Jun 2003
Location: Richmond (Virginia that is!)
Posts: 2,964
missinglinq is a jewel in the roughmissinglinq is a jewel in the roughmissinglinq is a jewel in the roughmissinglinq is a jewel in the rough
As Tim says, you'll have to write code to handle the "All" option for the combobox, depending on exactly what it is you're doing, but in order to get the "All" option at the top of your combobox, replace its RowSource by with this:

SELECT YourFieldName FROM YourTableName
UNION SELECT "(All)" FROM YourTableName;

Good Luck!
__________________
There's ALWAYS more than one way to skin a cat!
Reply With Quote
  #5  
Old 07-23-2007, 05:41 AM
eyg eyg is offline
Registered User
 
Join Date: Jul 2007
Posts: 2
eyg is on a distinguished road
Wink

Thanks for that - I think I will try with the Multiselect list box first (as I am still learning) and will try out the other coding when I am more familiar.
Thanks for all your help.
Reply With Quote
  #6  
Old 07-23-2007, 08:42 AM
Tim L's Avatar
Tim L Tim L is offline
Registered User
 
Join Date: Sep 2002
Location: England, UK
Posts: 406
Tim L is on a distinguished road
Send a message via Yahoo to Tim L
Goog luck (and not meant sarcastically). I've been using Access now for half a dozen years and still haven't figured out about using multiple select in List Boxes, mostly because all of the advice I have seen was along the lines of 'there be dragons', so I'll be interested to see your solution.
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes 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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Single Select List Box rerichards Modules & VBA 2 04-26-2005 11:23 AM
Cascading Combo Box Problem clf Forms 1 06-23-2004 07:07 PM
How do I issue items from a multi-level inventory? ltl Forms 5 01-27-2004 12:32 PM
Combo Box, Click to Select? GoinDeep Forms 2 06-03-2003 10:33 AM
Allow the contents of one combo box to be determined the value of another jmriddic Forms 1 09-18-2001 08:44 AM


All times are GMT -8. The time now is 09:01 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World