A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Criteria based on checkbox



 
 
Thread Tools Display Modes
  #11  
Old December 1st, 2009, 05:11 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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]
  #12  
Old December 1st, 2009, 05:58 PM posted to microsoft.public.access.queries
Paul Washburn[_2_]
external usenet poster
 
Posts: 31
Default Criteria based on checkbox

I built the query using the query builder in access, so i the only additional
code is the default code from the builder.

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE (((bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
The code i posted earlier was placed in the criteria section of the builder.
For the chkedi field.


Thanks

"John W. Vinson" wrote:

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]
.

  #13  
Old December 1st, 2009, 05:58 PM posted to microsoft.public.access.queries
Paul Washburn[_2_]
external usenet poster
 
Posts: 31
Default Criteria based on checkbox

I built the query using the query builder in access, so i the only additional
code is the default code from the builder.

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE (((bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
The code i posted earlier was placed in the criteria section of the builder.
For the chkedi field.


Thanks

"John W. Vinson" wrote:

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]
.

  #14  
Old December 1st, 2009, 05:58 PM posted to microsoft.public.access.queries
Paul Washburn[_2_]
external usenet poster
 
Posts: 31
Default Criteria based on checkbox

I built the query using the query builder in access, so i the only additional
code is the default code from the builder.

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE (((bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
The code i posted earlier was placed in the criteria section of the builder.
For the chkedi field.


Thanks

"John W. Vinson" wrote:

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]
.

  #15  
Old December 2nd, 2009, 05:54 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Criteria based on checkbox

On Tue, 1 Dec 2009 09:58:02 -0800, Paul Washburn
wrote:

I built the query using the query builder in access, so i the only additional
code is the default code from the builder.

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE (((bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));

The code i posted earlier was placed in the criteria section of the builder.
For the chkedi field.


So you had

([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi]

as a criterion? That doesn't resemble what you posted as the SQL of the query.

What are form_name and chkEdi? I missed some of the start of this thread and
I'm not sure of the context here!
--

John W. Vinson [MVP]
  #16  
Old December 2nd, 2009, 05:54 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Criteria based on checkbox

On Tue, 1 Dec 2009 09:58:02 -0800, Paul Washburn
wrote:

I built the query using the query builder in access, so i the only additional
code is the default code from the builder.

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE (((bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));

The code i posted earlier was placed in the criteria section of the builder.
For the chkedi field.


So you had

([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi]

as a criterion? That doesn't resemble what you posted as the SQL of the query.

What are form_name and chkEdi? I missed some of the start of this thread and
I'm not sure of the context here!
--

John W. Vinson [MVP]
  #17  
Old December 2nd, 2009, 05:54 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Criteria based on checkbox

On Tue, 1 Dec 2009 09:58:02 -0800, Paul Washburn
wrote:

I built the query using the query builder in access, so i the only additional
code is the default code from the builder.

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE (((bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));

The code i posted earlier was placed in the criteria section of the builder.
For the chkedi field.


So you had

([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi]

as a criterion? That doesn't resemble what you posted as the SQL of the query.

What are form_name and chkEdi? I missed some of the start of this thread and
I'm not sure of the context here!
--

John W. Vinson [MVP]
  #18  
Old December 2nd, 2009, 07:54 PM posted to microsoft.public.access.queries
Paul Washburn[_2_]
external usenet poster
 
Posts: 31
Default Criteria based on checkbox

Yes, ([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] was
originally entered as criteria. Didnt even know about the sql code in the
background until you asked about it. Started the form again and watched the
code in the background this time. The code started as

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE ((([Forms]![FormRpt]![chkEdi]=False) Or 
(bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
I ran it once unchecked which produced no records; once checked which
produced no records; and then a third time unchecked which produced all
records and modified the code to this:

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE ((([Forms]![FormRpt]![chkEdi]=False) Or 
(bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
Im still fairly new with sql but i was thinking a switch statement might
work something along the lines of (chkbox A, select statement, chkbox b,
select statement, chkbox A and chkbox B, select statement)

Thanks for the help

"John W. Vinson" wrote:

On Tue, 1 Dec 2009 09:58:02 -0800, Paul Washburn
wrote:

I built the query using the query builder in access, so i the only additional
code is the default code from the builder.

Code:
 SELECT bncforms_table.formnumber, bncforms_table.form_name, 
 bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
 bncforms_table.[No Enter]
 FROM bncforms_table
 WHERE (((bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
 

The code i posted earlier was placed in the criteria section of the builder.
For the chkedi field.


So you had

([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi]

as a criterion? That doesn't resemble what you posted as the SQL of the query.

What are form_name and chkEdi? I missed some of the start of this thread and
I'm not sure of the context here!
--

John W. Vinson [MVP]
.

  #19  
Old December 2nd, 2009, 07:54 PM posted to microsoft.public.access.queries
Paul Washburn[_2_]
external usenet poster
 
Posts: 31
Default Criteria based on checkbox

Yes, ([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] was
originally entered as criteria. Didnt even know about the sql code in the
background until you asked about it. Started the form again and watched the
code in the background this time. The code started as

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE ((([Forms]![FormRpt]![chkEdi]=False) Or 
(bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
I ran it once unchecked which produced no records; once checked which
produced no records; and then a third time unchecked which produced all
records and modified the code to this:

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE ((([Forms]![FormRpt]![chkEdi]=False) Or 
(bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
Im still fairly new with sql but i was thinking a switch statement might
work something along the lines of (chkbox A, select statement, chkbox b,
select statement, chkbox A and chkbox B, select statement)

Thanks for the help

"John W. Vinson" wrote:

On Tue, 1 Dec 2009 09:58:02 -0800, Paul Washburn
wrote:

I built the query using the query builder in access, so i the only additional
code is the default code from the builder.

Code:
 SELECT bncforms_table.formnumber, bncforms_table.form_name, 
 bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
 bncforms_table.[No Enter]
 FROM bncforms_table
 WHERE (((bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
 

The code i posted earlier was placed in the criteria section of the builder.
For the chkedi field.


So you had

([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi]

as a criterion? That doesn't resemble what you posted as the SQL of the query.

What are form_name and chkEdi? I missed some of the start of this thread and
I'm not sure of the context here!
--

John W. Vinson [MVP]
.

  #20  
Old December 2nd, 2009, 07:54 PM posted to microsoft.public.access.queries
Paul Washburn[_2_]
external usenet poster
 
Posts: 31
Default Criteria based on checkbox

Yes, ([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi] was
originally entered as criteria. Didnt even know about the sql code in the
background until you asked about it. Started the form again and watched the
code in the background this time. The code started as

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE ((([Forms]![FormRpt]![chkEdi]=False) Or 
(bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
I ran it once unchecked which produced no records; once checked which
produced no records; and then a third time unchecked which produced all
records and modified the code to this:

Code:
SELECT bncforms_table.formnumber, bncforms_table.form_name, 
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
bncforms_table.[No Enter]
FROM bncforms_table
WHERE ((([Forms]![FormRpt]![chkEdi]=False) Or 
(bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
Im still fairly new with sql but i was thinking a switch statement might
work something along the lines of (chkbox A, select statement, chkbox b,
select statement, chkbox A and chkbox B, select statement)

Thanks for the help

"John W. Vinson" wrote:

On Tue, 1 Dec 2009 09:58:02 -0800, Paul Washburn
wrote:

I built the query using the query builder in access, so i the only additional
code is the default code from the builder.

Code:
 SELECT bncforms_table.formnumber, bncforms_table.form_name, 
 bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc], 
 bncforms_table.[No Enter]
 FROM bncforms_table
 WHERE (((bncforms_table.form_name)=[Forms]![FormRpt]![chkEdi]));
 

The code i posted earlier was placed in the criteria section of the builder.
For the chkedi field.


So you had

([Forms]![FormRpt]![chkEdi]=False) Or [Forms]![FormRpt]![chkEdi]

as a criterion? That doesn't resemble what you posted as the SQL of the query.

What are form_name and chkEdi? I missed some of the start of this thread and
I'm not sure of the context here!
--

John W. Vinson [MVP]
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.