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 
A better way than FormCurrent
John S 

3 years ago
I want to see if I'm missing something easy:

I have a checkbox on form that, when checked, changes the background color of a related text box (and changes it back when unchecked). This is done using VBA. The value represented by this checkbox is saved in a Yes/No variable in the main table.

I have a simple If-Then-Else statement associated with the Click event of the checkbox. This changes the color when I click on the checkbox on the form.

My question concerns moving from record to record in the form.

To reflect this correct status of this checkbox on the form for the other records, the solution I'm using is to use the same If-Then-Else statement to the Form_Current sub, so that when the form moves to the next record, it looks at the value of the checkbox and processes the If-Then-Else statement.

Is there a more correct or more efficient way of doing this that I don't know about?

Thanks.
Kevin Robertson  @Reply  
          
3 years ago
Create your own sub-routine and call it from both the Click event, or the After Update event (I prefer After Update), and the On Current Event. This prevents having duplicate code.
John S OP  @Reply  

3 years ago
Thanks, Kevin. That makes a lot of sense.

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/7/2026 12:53:50 AM. PLT: 0s