check box from table

  • Thread starter Thread starter rbchildrn
  • Start date Start date
R

rbchildrn

Hello. I have a table that includes a yes/no column for whether or not
we send mail to each record. I need to run a query that doesn't show
those who have the box unchecked. I can't find an answer for this
seemingly simple problem in the posts.

I have verified that all records in the table have a value in the
yes/no (check box) field, and the query returns all records whether my
criteria is True, -1, or Not False! It seems like it should work, it
just doesn't.

Let me know what other info you need. I do have other criteria for
other fields in the query - could they be interfering somehow?

Thanks
 
FYI: I just noticed I also have a field "Status" that is either
"Active" or "Inactive", and the criteria ="Active" returns all records
also. I have another checkbox "Family" that adds "and Family" to the
Name, and this works like a charm.
 
My original post states that -1 does not work in the criteria, and
neither does "True" or "Not False." There's something trickier going
on here...
 
Here is the SQL:

SELECT Trim(TblPeople.NamePrefix & " " & TblPeople.FirstName & " " &
TblPeople.MiddleInitial & " " & TblPeople.LastName & " " &
TblPeople.NameSuffix & " " & (IIf(TblPeople.[Family Address?]=True,"and
Family",Null))) AS PrintName, TblPeople.Address1, TblPeople.Address2,
TblPeople.City, TblPeople.State, TblPeople.Zip
FROM TblPeople INNER JOIN [QryDonation Totals Ind] ON TblPeople.Id =
[QryDonation Totals Ind].Id
WHERE (((TblPeople.City)=NZ([Forms]![Create Data Source for
Mailings].[Text2],[TblPeople].[City])) AND (([QryDonation Totals
Ind].SumOfDonationAmount)>=NZ([Forms]![Create Data Source for
Mailings].[Text0],0)) AND ((TblPeople.[Addressee?])=True) AND
((TblPeople.MembershipStatus)="Active") AND
((TblPeople.[Adult?])=True)) OR ((([QryDonation Totals
Ind].SumOfDonationAmount) Is Null));


The first part adds some fields together so that I can match fields for
a Union Query with Organization mailing info. There is also
referenced a query that totals donation amounts per person. In the
WHERE statement I am referencing text boxes on forms where the user can
enter minimum donation total or City.

I hope this helps! Thanks
 
OK, I think I win the stupid award for today (this week? this year?)
I previously made some changes to tables, and forgot to redraw the
relationships! WOW

I'll update when I have that done... geez...
 
The simple answer I found in a post subject: Criteria priority

When you have an Or statement (the second criteria line in the Query
Builder) in one column, you have to duplicate the criteria for the Or
row of each other column that specifies criteria. Seems strange, but
it worked.
 
Back
Top