If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Criteria based on checkbox
Im trying to create a query that will return all results, but will apply
filters based on a checkbox. I found the code below from a previous question, but this returns zero records if the box is unchecked. Thanks for any help. [code] [Forms]![FormRpt]![chkEdi] Or [Forms]![FormRpt]![chkEdi]=False [code] |
#2
|
|||
|
|||
Criteria based on checkbox
Hi Paul,
your criteria is checking for True and for False ... but what if the checkbox is null? this will look at the checkbox for a value and if it is null, it will assume it is false: nz([Forms]![FormRpt]![chkEdi],false) to work, FormRpt must be open Warm Regards, Crystal remote programming and training http://MSAccessGurus.com free video tutorials http://www.YouTube.com/user/LearnAccessByCrystal Access Basics http://www.AccessMVP.com/strive4peace free 100-page book that covers essentials in Access * (: have an awesome day * Paul Washburn wrote: Im trying to create a query that will return all results, but will apply filters based on a checkbox. I found the code below from a previous question, but this returns zero records if the box is unchecked. Thanks for any help. [code] [Forms]![FormRpt]![chkEdi] Or [Forms]![FormRpt]![chkEdi]=False [code] |
#3
|
|||
|
|||
Criteria based on checkbox
Thanks,
Not quite what im looking for though. I need the report to show all records if nothing is checked. You example showed all records where the box was unchecked. I found that flipping my orignal code gave me the results i was looking for. IE: Displayed all records when unchecked and only the pertaining records when checked. Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] Hi Paul, your criteria is checking for True and for False ... but what if the checkbox is null? this will look at the checkbox for a value and if it is null, it will assume it is false: nz([Forms]![FormRpt]![chkEdi],false) to work, FormRpt must be open Warm Regards, Crystal remote programming and training http://MSAccessGurus.com free video tutorials http://www.YouTube.com/user/LearnAccessByCrystal Access Basics http://www.AccessMVP.com/strive4peace free 100-page book that covers essentials in Access * (: have an awesome day * Paul Washburn wrote: Im trying to create a query that will return all results, but will apply filters based on a checkbox. I found the code below from a previous question, but this returns zero records if the box is unchecked. Thanks for any help. [code] [Forms]![FormRpt]![chkEdi] Or [Forms]![FormRpt]![chkEdi]=False [code] . |
#4
|
|||
|
|||
Criteria based on checkbox
Thanks,
Not quite what im looking for though. I need the report to show all records if nothing is checked. You example showed all records where the box was unchecked. I found that flipping my orignal code gave me the results i was looking for. IE: Displayed all records when unchecked and only the pertaining records when checked. Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] Hi Paul, your criteria is checking for True and for False ... but what if the checkbox is null? this will look at the checkbox for a value and if it is null, it will assume it is false: nz([Forms]![FormRpt]![chkEdi],false) to work, FormRpt must be open Warm Regards, Crystal remote programming and training http://MSAccessGurus.com free video tutorials http://www.YouTube.com/user/LearnAccessByCrystal Access Basics http://www.AccessMVP.com/strive4peace free 100-page book that covers essentials in Access * (: have an awesome day * Paul Washburn wrote: Im trying to create a query that will return all results, but will apply filters based on a checkbox. I found the code below from a previous question, but this returns zero records if the box is unchecked. Thanks for any help. [code] [Forms]![FormRpt]![chkEdi] Or [Forms]![FormRpt]![chkEdi]=False [code] . |
#5
|
|||
|
|||
Criteria based on checkbox
Thanks,
Not quite what im looking for though. I need the report to show all records if nothing is checked. You example showed all records where the box was unchecked. I found that flipping my orignal code gave me the results i was looking for. IE: Displayed all records when unchecked and only the pertaining records when checked. Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] Hi Paul, your criteria is checking for True and for False ... but what if the checkbox is null? this will look at the checkbox for a value and if it is null, it will assume it is false: nz([Forms]![FormRpt]![chkEdi],false) to work, FormRpt must be open Warm Regards, Crystal remote programming and training http://MSAccessGurus.com free video tutorials http://www.YouTube.com/user/LearnAccessByCrystal Access Basics http://www.AccessMVP.com/strive4peace free 100-page book that covers essentials in Access * (: have an awesome day * Paul Washburn wrote: Im trying to create a query that will return all results, but will apply filters based on a checkbox. I found the code below from a previous question, but this returns zero records if the box is unchecked. Thanks for any help. [code] [Forms]![FormRpt]![chkEdi] Or [Forms]![FormRpt]![chkEdi]=False [code] . |
#6
|
|||
|
|||
Criteria based on checkbox
Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] The code above is working very sparadically. Ill run it once and get nothing, run it again and get all results, run it a third time and get the correct results. In the background the criteria is getting moved around, added as new fields, and duplicated throughout the criteria. Any help would be appreciated. Thank you. "Paul Washburn" wrote: Thanks, Not quite what im looking for though. I need the report to show all records if nothing is checked. You example showed all records where the box was unchecked. I found that flipping my orignal code gave me the results i was looking for. IE: Displayed all records when unchecked and only the pertaining records when checked. Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] "Crystal (strive4peace)" wrote: Hi Paul, your criteria is checking for True and for False ... but what if the checkbox is null? this will look at the checkbox for a value and if it is null, it will assume it is false: nz([Forms]![FormRpt]![chkEdi],false) to work, FormRpt must be open Warm Regards, Crystal remote programming and training http://MSAccessGurus.com free video tutorials http://www.YouTube.com/user/LearnAccessByCrystal Access Basics http://www.AccessMVP.com/strive4peace free 100-page book that covers essentials in Access * (: have an awesome day * Paul Washburn wrote: Im trying to create a query that will return all results, but will apply filters based on a checkbox. I found the code below from a previous question, but this returns zero records if the box is unchecked. Thanks for any help. [code] [Forms]![FormRpt]![chkEdi] Or [Forms]![FormRpt]![chkEdi]=False [code] . |
#7
|
|||
|
|||
Criteria based on checkbox
Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] The code above is working very sparadically. Ill run it once and get nothing, run it again and get all results, run it a third time and get the correct results. In the background the criteria is getting moved around, added as new fields, and duplicated throughout the criteria. Any help would be appreciated. Thank you. "Paul Washburn" wrote: Thanks, Not quite what im looking for though. I need the report to show all records if nothing is checked. You example showed all records where the box was unchecked. I found that flipping my orignal code gave me the results i was looking for. IE: Displayed all records when unchecked and only the pertaining records when checked. Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] "Crystal (strive4peace)" wrote: Hi Paul, your criteria is checking for True and for False ... but what if the checkbox is null? this will look at the checkbox for a value and if it is null, it will assume it is false: nz([Forms]![FormRpt]![chkEdi],false) to work, FormRpt must be open Warm Regards, Crystal remote programming and training http://MSAccessGurus.com free video tutorials http://www.YouTube.com/user/LearnAccessByCrystal Access Basics http://www.AccessMVP.com/strive4peace free 100-page book that covers essentials in Access * (: have an awesome day * Paul Washburn wrote: Im trying to create a query that will return all results, but will apply filters based on a checkbox. I found the code below from a previous question, but this returns zero records if the box is unchecked. Thanks for any help. [code] [Forms]![FormRpt]![chkEdi] Or [Forms]![FormRpt]![chkEdi]=False [code] . |
#8
|
|||
|
|||
Criteria based on checkbox
Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] The code above is working very sparadically. Ill run it once and get nothing, run it again and get all results, run it a third time and get the correct results. In the background the criteria is getting moved around, added as new fields, and duplicated throughout the criteria. Any help would be appreciated. Thank you. "Paul Washburn" wrote: Thanks, Not quite what im looking for though. I need the report to show all records if nothing is checked. You example showed all records where the box was unchecked. I found that flipping my orignal code gave me the results i was looking for. IE: Displayed all records when unchecked and only the pertaining records when checked. Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] "Crystal (strive4peace)" wrote: Hi Paul, your criteria is checking for True and for False ... but what if the checkbox is null? this will look at the checkbox for a value and if it is null, it will assume it is false: nz([Forms]![FormRpt]![chkEdi],false) to work, FormRpt must be open Warm Regards, Crystal remote programming and training http://MSAccessGurus.com free video tutorials http://www.YouTube.com/user/LearnAccessByCrystal Access Basics http://www.AccessMVP.com/strive4peace free 100-page book that covers essentials in Access * (: have an awesome day * Paul Washburn wrote: Im trying to create a query that will return all results, but will apply filters based on a checkbox. I found the code below from a previous question, but this returns zero records if the box is unchecked. Thanks for any help. [code] [Forms]![FormRpt]![chkEdi] Or [Forms]![FormRpt]![chkEdi]=False [code] . |
#9
|
|||
|
|||
Criteria based on checkbox
On Tue, 1 Dec 2009 07:13:02 -0800, Paul Washburn
wrote: Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] Update: The code above is working very sparadically. Ill run it once and get nothing, run it again and get all results, run it a third time and get the correct results. In the background the criteria is getting moved around, added as new fields, and duplicated throughout the criteria. Please post the *complete* SQL view of the query. As written it appears that this criterion will return the record if chkEDI is False or if it is True - i.e. I'd expect it to return all records. I'm sure that's not the case, so there's something else going on in the query! -- John W. Vinson [MVP] |
#10
|
|||
|
|||
Criteria based on checkbox
On Tue, 1 Dec 2009 07:13:02 -0800, Paul Washburn
wrote: Code:
([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] Update: The code above is working very sparadically. Ill run it once and get nothing, run it again and get all results, run it a third time and get the correct results. In the background the criteria is getting moved around, added as new fields, and duplicated throughout the criteria. Please post the *complete* SQL view of the query. As written it appears that this criterion will return the record if chkEDI is False or if it is True - i.e. I'd expect it to return all records. I'm sure that's not the case, so there's something else going on in the query! -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|