Using a Checkbox in Query

nico

Board Regular
Joined
Apr 26, 2005
Messages
111
I am using a form for users to enter critieria in order to display specific results in a report. The form is linked to an underlying query. My problem deals with a checkbox column that is in the table being searched. What I want to do is create a checkbox on my form so if users check it, then all results with a checked checkbox will display. If it is unchecked, then all results with an unchecked checkbox will display. So, I tried making a checkbox on my form. I named it "SearchBox", then in my Query, under the checkbox column criteria I put: [Forms]![Form Name]![SearchBox], but it does not work. If the box is checked or unchecked it does not affect the searched results. If I create a text box on my form and link it the same way to the query, and then type in "0": then all results display with an unchecked checkbox, and if I type in "-1", then all results display with the checked checkbox. I would like to accomplish this with a checkbox instead of a text box. I'm not sure what I am doing wrong with the format, if anyone has any ideas, I would greatly appreciate it. Thanks!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

NumbersMax

Board Regular
Joined
Jun 19, 2007
Messages
200
I actually did a little test on my own using you methodology. It seemed to work fine. Please double-check everything you can:

Make sure the criteria in the query points back to the checkbox and not the label for the checkbox

Make sure the spelling and syntax are correct on everything related to this query/form

Are they any other criteria and if so, how are they lined up with this checkbox criteria...on the same row/different row?

When you say the form is linked to an underlying query, is there a control source indicated in properties for the checkbox?

Max
 

Forum statistics

Threads
1,181,367
Messages
5,929,552
Members
436,677
Latest member
CathalP1992

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top