By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,852 Members | 955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,852 IT Pros & Developers. It's quick & easy.

Using "ALL" in form combo boxes as a query parameter

Zwoker
P: 66
Hi Everyone,

I have a query that uses criteria from combo boxes in the form that runs it.

When I had only discrete values in the combo boxes that matched the data that was being queried, the result was great. I was getting only the records that I wanted.

As soon as I added "ALL" to the form's combo item lists I ran into trouble.

Firstly how do I make the query realise that I want every record, not just those that match the literal "ALL", and secondly, how do I handle the use of "ALL" for numeric fields?


Thanks.
Aug 2 '07 #1
Share this Question
Share on Google+
3 Replies


puppydogbuddy
Expert 100+
P: 1,923
Hi Everyone,

I have a query that uses criteria from combo boxes in the form that runs it.

When I had only discrete values in the combo boxes that matched the data that was being queried, the result was great. I was getting only the records that I wanted.

As soon as I added "ALL" to the form's combo item lists I ran into trouble.

Firstly how do I make the query realise that I want every record, not just those that match the literal "ALL", and secondly, how do I handle the use of "ALL" for numeric fields?


Thanks.
First, set the default value of your combo box to "*"; then follow the steps in this link:

http://www.fabalou.com/Access/Forms/...oxextrarow.asp
Aug 3 '07 #2

Zwoker
P: 66
Thanks puppydogbuddy,

That page does address the general issue that I have, unfortunately I haven't been using any code in my solution - The combo boxes are using items I entered in their Row Source, etc... So it doesn't seem to fit my problem.

I tried implementing the general ideas from that page but I guess I didn't do so well, as it was still giving me the same issues - The alpha field I have wasn't matching anything if I chose "ALL" from the list, even though I had a (hidden) second column in the combo box that held an asterisk for the row, and was being referenced (I believe) by the criteria field in the Query.

The numeric parameter was even worse, in that it just gives a type mismatch still, when I did the same for it, and choose the "ALL".

Perhaps the problem is in the way that the query references the data from the combo box? I have named the hidden column with the asterisk against the "ALL" as the bound column for the combo box, but perhaps there is more to it? Do I need to include some sort of "Like" with the query criteria?

I'm confused. :(

Thanks for any suggestions any one has. I had hoped that this was a common thing that people would have done, to include an "ALL" option along with selectable items on their forms, and have it effective ignore that field in the query selection criteria.
Aug 5 '07 #3

puppydogbuddy
Expert 100+
P: 1,923
Please post the sql of the query you are using as the row source for your combo box. Also, please identify the bound column.
Aug 6 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.