Full Version: View All Option In Combo Box In Ms Access 2007
UtterAccess Forums > Microsoft® Access > Access Forms
amit_amt
Hello,
We have application in ms-access 2007. He want "View All" option in the combo box. So, if any user will check "veiw All" checkbox all the checkboxes should be automaticaly checked and if he uncheck any it sould uncheck the "View All" check box. combo data is coming from DB only and sometimes flitering from previous combo box.
Thank you very much in advance for your support.
Regards,
Amit A.
datAdrenaline
From your post I am not completely sure I understand the final need since you mention check boxes as well as a combo box. So, I will assume you wish to add a 'View All' option to a combo box list. To do that you can use a UNION query to add the 'View All' option. For example, lets say your combo shows a list of choices that is 2 columns (ID, SomeField), your bound column is column 1, and the width of column 1 is 0 in order to only show the Value that corresponds to the ID selected. In such a case, the RowSourceType would be set to Table/Query, and you would set your RowSource to something like this:
SELECT ID, SomeField FROM SomeTable
UNION SELECT TOP 1 0 As ID, "<View All>" As SomeField FROM MSysObjects
Orderpost I am not completely sure I understand the final need since you mention check boxes as well as a combo box. So, I will assume you wish to add a 'View All' option to a combo box list. To do that you can use a UNION query to add the 'View All' option. For example, lets say your combo shows a list of choices that is 2 columns (ID, SomeField), your bound column is column 1, and the width of column 1 is 0 in order to only show the Value that corresponds to the ID selected. In such a case, the RowSourceType would be set to Table/Query, and you would set your RowSource to something like this:
SELECT ID, SomeField FROM SomeTable
UNION SELECT TOP 1 0 As ID, "<View All>" As SomeField FROM MSysObjects
ORDER BY SomeField
You can use ANY table you wish where I have used MSysObjects. I personally use MSysObjects table when my when creating my app as an MDB/ACCDB file simply because I know its always there, and it is local, thus helping efficientcy.
-------
Hope that helps!
theDBguy
Hi Brent,
saw this thread earlier and was trying to figure it out. I think the OP is referring to Multi-Value Fields in Acc2007, where it becomes a multi-checkbox combobox in a form.
I want be wrong though...
By the way, Amit A.
Welcome to UtterAccess!
welcome2UA.gif
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.