Select ALL option in ComboBox

reddevil1

Registered User.
Local time
Today, 10:47
Joined
Nov 12, 2012
Messages
92
Please could anyone advise or give a link to a simple way of adding ALL to a Select Query-Combo Box?

I am not very good with code but really need to do this.

Thanks
 
Hello RedDevil, with a SELECT Query-Combo Box it might not be possible.. Unless you want the SELECT Query to be dynamic.. So I have created a small sample, which should help you out.. What I have done is:
* A Table with agent names.
* A Form with a Combo Box, that has the row source type property set to 'Value List'.
* On the form current property, I have used the SELECT query that I want but also manually added a 'All' as another value..

So it not only uses the SELECT query that you want but also a ALL word added to it.. Look into the attachment for more details, post back if you need some help..
 

Attachments

pr2,
thanks very much for your input.
The sample database works great - it is just that my requirement needs a combo box which is linked to a query, with ALL as a choice.\\I have managed to find the following code - which does not work.

SELECT qryFindContract.ContractID, qryFindContract.StartDate, qryFindContract.EndDate, qryFindContract.OwnerName1
FROM qryFindContract UNION SELECT '(All)', null FROM qryFindContract

I get an error message about 'the number of columns in the two selected tables or queries of a union query do not match'.
 
Well UNION query needs to have the two tables/Queries that will have the exact same number of fields.. also the data types should be the same.. Look into this link on more info about UNION Query.. Having said that.. Did you try to adapt the code I had in my sample?
 

Users who are viewing this thread

Back
Top Bottom