Using Checkbox to Show or not Show QUERY columns?

rodvaN

Registered User.
Local time
Today, 12:54
Joined
May 20, 2009
Messages
92
Hello there..
How Can I use a checkbox on a FORM for activate or deactivate the checkbox on "Show" from QUERYS desgin view?
Thanks in advance
 
Why not use different queries based upon te ckeckbox value?
 
rodvaN,

As far as I know, the check box that you see in the QBE window is not a property that can be manipulated through code. That check box is there to tell the Access compilier how to render the SQL statement when the user has completed designing the query. When the "Show" is checked, this says to include that field in the field list in the SQL statement. When it is not checked then the field is either left completely out of the SQL statement or if there is criteria for that field, then that field is included in the WHERE part of the SQL statement. If that field is just being used to specify the sort order then that field would only be included in the ORDER By statement in the SQL statement.

With all that said, as llkhoutx said, you can use a different sql statment that excludes the field(s) you do not want to see. You can then swap out the SQL statements when the user clicks a checkbox if you like.

HTH
 

Users who are viewing this thread

Back
Top Bottom