Query By Form - Checkboxes

silver

New member
Local time
Today, 13:21
Joined
Jan 26, 2009
Messages
7
Hi Guys!

I have a form which contains multiple checkboxes and a button. On clicking the button i would like to query the information that matches the checked boxes only from a single table.

How can i do this taking into consideration the unchecked ones?

Any advice/references greatly appreciated
 
Hi Guys!

I have a form which contains multiple checkboxes and a button. On clicking the button i would like to query the information that matches the checked boxes only from a single table.

How can i do this taking into consideration the unchecked ones?

Any advice/references greatly appreciated


I am not sure that concern about whether a checkbox has been Selected/Unselected is even necessary for this example.

When Dealing with Checkboxes in most versions of SQL, the following is true:
  • An Unselected Box has a value of 0
  • A Selected Box has a value of NOT 0 (In most cases it is 1 or -1)
Using thes statements as rules, it becomes clear that selecting any checkbox with a non-zero value will do two things:
  1. Get any record that has been Selected
  2. Ignore any Record that has not been selected
See if this helps you to make your query
 
As an expansion on MSAccessRookie's comments, in the criteria of a query -1 and True are interchangeable for a checked check box whilst 0 and False are interchangeable for an unchecked check box.
 

Users who are viewing this thread

Back
Top Bottom