Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Triple State Check boxes
Michael Duncan 
     
3 years ago
Hi guys I am building a movie database.  I have a continuous form with all my titles on it including wish list and collection.  I would like to use a triple state check box to view either list.  My record source for the form is a table.  How do I code the check box this way?

Thank You
Juan C Rivera  @Reply  
            
3 years ago
Access SQL Seminars

You will need to set up conditions on the status of the checkbox, then apply the SQL with a requery.  
Dim strSQL As String
strSQL = "SELECT * FROM ..."

If (Check199) Then
  strSQL = strSQL & "WHERE Status IN (x, y)"
Else
  strSQL = strSQL & "WHERE Status IN (z, a)"
End If

Me.RecordSource = strSQL
'Me.Requery

This is covered in the SQL Seminar

you can thank Alex this was done by him about 8 years ago.  

V/r
Juan
Gregory Clancey  @Reply  
    
3 years ago
Am I slow, or do I see only 2 conditions here -- cheque: TRUE / cheque: FALSE.
I may be failing to see how the 3rd condition directs program flow.

(note: The answer to my "Am I slow" question, above, may be self-evident.)
Kevin Robertson  @Reply  
          
3 years ago
Gregory,

This is how I would normally use a Triple State Check Box in this situation.

True: Show one list
False: Show the other list
Null: Show both lists
Gregory Clancey  @Reply  
    
3 years ago
Thanks. I'll work with this to gain familiarity.

So TRUE is chequed, FALSE is the empty box and NULL is a box with gray fill; and, we can inspect this state of the control to make the appropriate code branching.
Gregory Clancey  @Reply  
    
3 years ago
Sorry -- NULL is the box with the black fill. Once the control has been chequed, it can easily toggle between TRUE and FALSE via the spacebar, but is it possible to get back to NULL?
Juan C Rivera  @Reply  
            
3 years ago
if you click on it it will toggle thru the 3 null, true, false.  I myself like radio buttons.
Gregory Clancey  @Reply  
    
3 years ago
Thanks, Juan.
Got it!

Rich has a great TechHelp vid. So, to enable the triple-state toggle the control must be bound to a Long Integer, Numeric table field (not the typical Boolean type) with a default of "NULL" and "Required Property" set to "No."

Typing this message will give me a quick place to refresh my memory in future. Also, others who happen upon this can become informed as well. Thanks again.
Scott Axton  @Reply  
      
3 years ago
Gregory
Check out the article on Allen Browne's website. Why I stopped using Yes/No fields

He has not updated the site for over 10 years but there are lots of valuable little tidbits there.  Scroll all the way to the bottom and click the Home link to view more.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/30/2026 3:12:17 AM. PLT: 1s