If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Adding an extra choice to a ListBox
Hi all,
Can I populate a ListBox (or ComboBox) with the rows drawn from a query AND the choice "All" listed as the first row of the ListBox? If so how? This box would allow the user to filter some data based on the row selected or to not filter at all (at least based on that one field). Thanks for any help in advance! |
#2
|
|||
|
|||
Adding an extra choice to a ListBox
By the way, I'm using Access 97.
"April Marano" wrote in message ... Hi all, Can I populate a ListBox (or ComboBox) with the rows drawn from a query AND the choice "All" listed as the first row of the ListBox? If so how? This box would allow the user to filter some data based on the row selected or to not filter at all (at least based on that one field). Thanks for any help in advance! |
#3
|
|||
|
|||
Adding an extra choice to a ListBox
Make an Union Query out of your query and another query that returns the word
"All". Look in the Help file to create the correct query containing "All". -- PC Datasheet Your Resource For Help With Access, Excel And Word Applications www.pcdatasheet.com "April Marano" wrote in message ... By the way, I'm using Access 97. "April Marano" wrote in message ... Hi all, Can I populate a ListBox (or ComboBox) with the rows drawn from a query AND the choice "All" listed as the first row of the ListBox? If so how? This box would allow the user to filter some data based on the row selected or to not filter at all (at least based on that one field). Thanks for any help in advance! |
#4
|
|||
|
|||
Adding an extra choice to a ListBox
Great, that makes sense. Now how do I sort this new query in such a way
that "All" appears as the first row? April Make an Union Query out of your query and another query that returns the word "All". Look in the Help file to create the correct query containing "All". |
#5
|
|||
|
|||
Adding an extra choice to a ListBox
If you have no other choices at a lower alphabetical order than "All" you just
need to sort ascending. If you have lower level choices, use "All". Special characters sort lower than alpha characters so "All" will appear first sorted ascending. Steve PC Datasheet "April Marano" wrote in message ... Great, that makes sense. Now how do I sort this new query in such a way that "All" appears as the first row? April Make an Union Query out of your query and another query that returns the word "All". Look in the Help file to create the correct query containing "All". |
#6
|
|||
|
|||
Adding an extra choice to a ListBox
Thanks Steve. I'll try that.
April "PC Datasheet" wrote in message link.net... If you have no other choices at a lower alphabetical order than "All" you just need to sort ascending. If you have lower level choices, use "All". Special characters sort lower than alpha characters so "All" will appear first sorted ascending. Steve PC Datasheet |
#7
|
|||
|
|||
Adding an extra choice to a ListBox
I usually add a DisplayOrder column, and set the *All* column's DisplayOrder
= 0, then order the whole recordset on DisplayOrder. SELECT Field1, Field2, 1 As DisplayOrder FROM tblMyTable UNION SELECT "-- All --" As Field1, "" As Field2, 0 As DisplayOrder FROM MSysObjects WHERE [Name] = "MSysDb" ORDER BY DisplayOrder Regards, Graham R Seach Microsoft Access MVP Sydney, Australia Microsoft Access 2003 VBA Programmer's Reference http://www.wiley.com/WileyCDA/WileyT...764559036.html "PC Datasheet" wrote in message link.net... If you have no other choices at a lower alphabetical order than "All" you just need to sort ascending. If you have lower level choices, use "All". Special characters sort lower than alpha characters so "All" will appear first sorted ascending. Steve PC Datasheet "April Marano" wrote in message ... Great, that makes sense. Now how do I sort this new query in such a way that "All" appears as the first row? April Make an Union Query out of your query and another query that returns the word "All". Look in the Help file to create the correct query containing "All". |
#8
|
|||
|
|||
Adding an extra choice to a ListBox
Graham,
I don't think you really need to add the DisplayOrder field. The two dashes in front of "All" should make it first in the sort order unless you have other selections beginning with special characters. If you try it, let me know. Steve PC Datasheet "Graham R Seach" wrote in message ... I usually add a DisplayOrder column, and set the *All* column's DisplayOrder = 0, then order the whole recordset on DisplayOrder. SELECT Field1, Field2, 1 As DisplayOrder FROM tblMyTable UNION SELECT "-- All --" As Field1, "" As Field2, 0 As DisplayOrder FROM MSysObjects WHERE [Name] = "MSysDb" ORDER BY DisplayOrder Regards, Graham R Seach Microsoft Access MVP Sydney, Australia Microsoft Access 2003 VBA Programmer's Reference http://www.wiley.com/WileyCDA/WileyT...764559036.html "PC Datasheet" wrote in message link.net... If you have no other choices at a lower alphabetical order than "All" you just need to sort ascending. If you have lower level choices, use "All". Special characters sort lower than alpha characters so "All" will appear first sorted ascending. Steve PC Datasheet "April Marano" wrote in message ... Great, that makes sense. Now how do I sort this new query in such a way that "All" appears as the first row? April Make an Union Query out of your query and another query that returns the word "All". Look in the Help file to create the correct query containing "All". |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding an extra choice to a ListBox | April Marano | New Users | 7 | July 8th, 2004 05:51 PM |
Adding my own button to the toolbar | Steve Rindsberg | Powerpoint | 4 | June 22nd, 2004 08:27 PM |
Adding auto-numbered field screws up Table order | Carl | Database Design | 5 | May 30th, 2004 03:25 AM |
manually adding a row to a ListBox | Lexta | New Users | 2 | May 28th, 2004 02:18 AM |
Newbie Question on Extra Space After Numeric Values | Yellowbird | Worksheet Functions | 3 | March 8th, 2004 05:40 PM |