Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Yes/No Fields    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Check Button
Robert Stott 
    
3 years ago
I have a check box and a Command Button. I am trying to set it so that when the check is checked the Command button is enabled. That works, except when I got to the next record it still has the command button enable regardless if it is the checked or uncheck on the next record.

DetailsPrivate Sub MadeNotesChk_Click()
On Error GoTo Err_MadeNotesChk_Click

    If MadeNotesChk.Value = True Then
        OpenBtn.Enabled = True
            Me.OpenBtn.BackColor = RGB(100, 28, 30)
        Else
            OpenBtn.Enabled = False
        Me.OpenBtn.BackColor = RGB(50, 100, 150)
    End If
Exit_MadeNotesChk_Click:
    Exit Sub
Err_MadeNotesChk_Click:
    MsgBox Err.Description
    Resume Exit_MadeNotesChk_Click
    
End Sub

Added this to BeforeUpdate to see if that would help when going to the next record - it didn't
DetailsPrivate Sub MadeNotesChk_BeforeUpdate(Cancel As Integer)
    If MadeNotesChk = False Then
        Me.OpenBtn.Enabled = False
        Me.OpenBtn.BackColor = RGB(50, 100, 150)
    Else
        Me.OpenBtn.BackColor = RGB(100, 28, 30)
    End If
    
End Sub

I need this to apply only to the current record
Alex Hedley  @Reply  
            
3 years ago
Add the same condition to the OnCurrent or OnOpen or one of those.

You've made it so with user interaction you can have the condition checked and actioned but you also need to check it when the Form first opens or when you change to another record, as when that happens you're not clicking on the checkbox yet.
Robert Stott OP  @Reply  
    
3 years ago
Thanks!!!!!, Moving the code to On Current worked perfectly. I don't know if there is class that deal with event timing on forms vs object events.
Alex Hedley  @Reply  
            
3 years ago
They're scattered throughout the TechHelps and the Access Courses.
But searching the site for keywords should hopefully find them from the index etc

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Yes/No Fields.
 

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: 4/30/2026 11:44:40 AM. PLT: 1s