Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Triple State < Gray Out Fields | Timestamp >
Back to Triple State    Comments List
Upload Images   Link   Email  
Triple State sequence
Jeffrey Rainey 
     
2 years ago
I don't care for my present sequence of the Triple State. If I set the default to null then the next click on checkbox makes it -1 and then 0.

Any way of making the sequence null, 0, -1 ?
Kevin Yip 
     
2 years ago
In your checkbox's Click event, check its value.  If the checkbox's value at that moment is True, set to to False.  If it is False, set it to Null.  If it is Null, set it to True.  It looks like this will just set it to the original order of True, False, Null, True, False, Null, etc.  But it won't.  It will set it to True, Null, False, True, Null, False, True, etc. as you desire.  

This is because when the Click event runs, the checkbox's value has already been changed by the tri-state effect.  So you need to base your logic on the value BEFORE it takes effect.
Jeffrey Rainey OP 
     
2 years ago
I tried what I thought you meant and could not make it work. I guess I would need a bit more detail to implement it the way you intended. It actually seems like how the checkbox presents itself is not changeable.
Kevin Yip 
     
2 years ago
You just need a simple If-Then-Else statement to check the checkbox's value and change it in the manner I described; nothing fancy.  If your checkbox's name is Check1, then the code is:

    Private Sub Check1_Click()
        If IsNull(Check1) Then
            Check1 = True
        ElseIf Check1 = True Then
            Check1 = False
        ElseIf Check1 = False Then
            Check1 = Null
        End If
    End Sub

The code changes it from null to true, true to false, or false to null.  You will see that you will get: null to false, false to true, true to null, exactly the order you want.  And that's all because you base your decision not on the checkbox's current value, but on its previous value, before triple state took effect.
Jeffrey Rainey OP 
     
2 years ago
Thanks for your time and effort. That worked for me. Thanks

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

 
 
 

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 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 2/11/2025 9:20:06 PM. PLT: 1s