Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query if/or check boxes are blank 1

Status
Not open for further replies.

PeggyBall

Technical User
Oct 30, 2006
19
US
Hello -
I have a student registration database which has the following fields (among other fields) in a table:
LastName (text)
FirstName (text)
BirthCertificate (check box - checked if Yes)
Physical (check box - checked if Yes)
ProofOfResidency (check box - checked if Yes)
Registration (check box - checked if Yes)

From a form I want the user to click a button which will run a query and display the results (only the fields listed above) in datasheet view so the user can then check off items turned in.

I have a select query to display LastName, FirstName, BirthCert (is null), Physical (is null), ProofOfResidency (is null), Registration (is null) but I don't get any results which I belive is because all check boxes must be blank. I want the records if any of those fields are blank.

Thanks for the help!

 
I have a form with a command button to open the query below. The records I want to see are those "Expected" students who are missing any one or more of the registration requirements.

Here is the SQL -

SELECT tblNewStudents.Status, tblNewStudents.LastName, tblNewStudents.FirstName, tblNewStudents.BirthCertificate, tblNewStudents.VAHealthForm, tblNewStudents.ProofOfResidency, tblNewStudents.Infosnap
FROM tblNewStudents
WHERE (((tblNewStudents.Status)="Expected") AND ((tblNewStudents.BirthCertificate)=False) AND ((tblNewStudents.Returning)=False)) OR (((tblNewStudents.VAHealthForm) Is Null) AND ((tblNewStudents.ProofOfResidency)=False) AND ((tblNewStudents.Infosnap)=False))
ORDER BY tblNewStudents.LastName, tblNewStudents.FirstName;
 
you may try this:
SELECT Status, LastName, FirstName, BirthCertificate, VAHealthForm, ProofOfResidency, Infosnap
FROM tblNewStudents
WHERE Status='Expected' AND (Nz(BirthCertificate)=False OR Nz(Returning)=False OR Nz(VAHealthForm)=False OR Nz(ProofOfResidency)=False OR Nz(Infosnap)=False)
ORDER BY LastName, FirstName

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I think I'm still missing something...I'm getting 290 records returned but should only get 29. In my table I have the following:
LastName
FirstName
Status - can either be "Expected" or "Census"
BirthCertificate - Check box (if checked they've turned it in)
VAHealthForm - dropdown - can be blank, Complete, Returned, Review
ProofOfResidency - check box (if checked they've turned it in)
Infosnap - check box (if checked they've completed online registration)

I want the query to eliminiate "Census" status records, then look at birth certificate, VA Health Form, Proof of Residency, Infosnap. If ANY one or more of those four fields are blank then return the record.

When I run the query (SQL below) I'm getting back Expected students who have all four fields checked.

SELECT Status, LastName, FirstName, BirthCertificate, VAHealthForm, ProofOfResidency, Infosnap
FROM tblNewStudents
WHERE Status='Expected' AND (Nz(BirthCertificate)=False OR Nz(Returning)=False OR Nz(VAHealthForm)=False OR Nz(ProofOfResidency)=False OR Nz(Infosnap)=False)
ORDER BY LastName, FirstName

Thanks for the help!
 
And this ?
WHERE Status='Expected' AND (BirthCertificate=False OR VAHealthForm Is Null OR ProofOfResidency=False OR Infosnap=False)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PH -
Works GREAT! Thank you for all the help!

PeggyBall
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top