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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
VBA Code
Leo Rivera 
   
2 years ago
Hi people, I need to assure a checkbox is marked by the user before the next record.  Can some body tell me what lesson Richard explain this?  What I want to do is assure the user check a box before starting to work in the next record. I did this code but not work:

If CHKBX1 = False Then
    MsgBox "Ensure the person is at the 314b list"
Else
    'do nothing
End If

I put this on the CheckBox Before Update Event but when I click next record the vba code not run.

Sami Shamma  @Reply  
             
2 years ago
Add

Cancel = TRUE

after the MsgBox
Leo Rivera OP  @Reply  
   
2 years ago
Sami thanks but not working.  Where do I put this code? Under check box itself event or Form Current Event?
Sami Shamma  @Reply  
             
2 years ago
On the Form Before Update event
Leo Rivera OP  @Reply  
   
2 years ago

Leo Rivera OP  @Reply  
   
2 years ago
I did what you recommend  me but I have this errror and I do not understand the check box name is correct. What I missing?
Sami Shamma  @Reply  
             
2 years ago
your Checkbox is called :

314blistbtn ????
Leo Rivera OP  @Reply  
   
2 years ago
yes
Leo Rivera OP  @Reply  
   
2 years ago
should be ckbox but that does not matter.
Leo Rivera OP  @Reply  
   
2 years ago
I see they dont like numbers in the names
Sami Shamma  @Reply  
             
2 years ago
That is not recommended to start your control names with numbers.

What type of field is this Control? it must be Yes/No for your code as entered to work
Leo Rivera OP  @Reply  
   
2 years ago
Sami thanks for all your help.  Problem fixed.
Richard Rost  @Reply  
          
2 years ago
You CAN start a field name with a number, but I don't recommend it. You'll have to put brackets around it everywhere you refer to it. So, basically, don't. Unless you inherited this database from someone else and it's too much work to fix it everywhere, change the field name.
Leo Rivera OP  @Reply  
   
2 years ago
Sami I have another question.  The code work fine but once I click ok in the msg box the new record is created.  What I have to do for return me to the record to complete the check box?
Sami Shamma  @Reply  
             
2 years ago
show me your code
Leo Rivera OP  @Reply  
   
2 years ago
Private Sub Form_BeforeUpdate(Cancel As Integer)

    If bListCkBox = False Then
        MsgBox ("Assure you review the person against the approved 314(b) List")
    Else
        Cancel = True
    End If
    
End Sub
Sami Shamma  @Reply  
             
2 years ago
If bListCkBox = False Then
        MsgBox ("Assure you review the person against the approved 314(b) List")
       Cancel = True
End If
Leo Rivera OP  @Reply  
   
2 years ago
Nice! thank you Sami!
Sami Shamma  @Reply  
             
2 years ago
You are welcome.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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:03 AM. PLT: 1s