Hi,
I have created Form and added 2 two combo box. In that combo box I have multiple values, I want to select all value by selecting "Select All" option.
can you please advice how I can add "Select All" option.
Hi,
I have created Form and added 2 two combo box. In that combo box I have multiple values, I want to select all value by selecting "Select All" option.
can you please advice how I can add "Select All" option.
that is not what a combo box is for. combo means pick 1 item (hence the nature)
if you want to pick 1 to N, use a list box.
(a hammer is for nails, a screwdriver is for screws)
make a union query for the row source of the combo box
SELECT [tblTable].[field] FROM [tblTable] UNION SELECT 0, "(Select All)" FROM [tblTable]
ORDER BY [tblTable].[field];
Then in your VBA look for build a query to filter on and look for the 0, meaning "Select All" and build the query string appropriately.
BTW: I'm assuming you're using these to filter data and they are unbound fields.
Thanks James, I created union query as below mentioned and I can see list of plants in combo box. But I am not able to create query in VBA. can you please help me for VBA query.
SELECT [plant2] FROM [ACT_Sub_table] UNION SELECT 0,"(Select All)" [Plant] FROM [Plant data ACT table];
try this
SELECT [plant2ID], [plant2Desc] FROM [ACT_Sub_table] UNION SELECT 0,"(Select All)" FROM [ACT_Sub_table] ORDER BY [plant2Desc];
I'm assuming you have a plant ID and a plant description with column 1 as your bound column. If not
SELECT [plant2] FROM [ACT_Sub_table] UNION SELECT "(Select All)" FROM [ACT_Sub_table] ORDER BY [plant2]
you added a second table, which I don't know what that was for.
Hi,
I used SELECT [plant2] FROM [ACT_Sub_table] UNION SELECT "(Select All)" FROM [ACT_Sub_table] ORDER BY [plant2]
its working, but when I select all I got error message " The Value you entered isn't valid for this field".
Plan column is Short text type.
Please advice.
As James stated earlier, controls used to enter/select filter criteria must be UNBOUND.
Is the combobox ValidationRule set?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.