Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Checkbox Order
Michael Johnson 
        
2 years ago
In a project, I had a need/desire to change the order that a triple state checkbox operates. I couldn't find anything inherent in Access. It normally goes: Null > True > False. I wanted it to go: Null > False > True. I was able to crack the code. It's not as intuitive as you would think, or at least that I would think. I'll attach the code in case it's useful to anyone else. I only set it up as a function so it can go into the Property Sheet since it's not returning a value. I put it in the After Update Event.
Michael Johnson OP  @Reply  
        
2 years ago

Kevin Robertson  @Reply  
           
2 years ago
I would use an Else in place of the last ElseIf since it can only be one other value.

Public Function UpdateCheckboxState(ControlName As Control)

'    If ControlName = False Then
'       ControlName = Null
'    ElseIf ControlName = True Then
'        ControlName = False
'    Else
'        ControlName = True
'    End If
    
'    Does the same as above but in one line of code
    ControlName = IIf(ControlName = False, Null, IIf(ControlName = True, False, True))
    
End Function
Michael Johnson OP  @Reply  
        
2 years ago
True. For me in that case, I did it for my own brain logic when I go back and look at it. But thank you for the feedback. I do appreciate others' point of view to help me think in different ways. :)
Kevin Yip  @Reply  
     
2 years ago
Someone has asked this once and I posted the same solution, and I tried to explain (though not very well) the trickiness of the situation:

    https://599cd.com/blog/display-comment.asp?CommentID=77496
Richard Rost  @Reply  
           
2 years ago
Thanks for sharing.

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: 5/6/2026 1:30:26 PM. PLT: 0s