Solved

Testing if checkbox is checked after update on Access Form

Posted on 2014-10-20
1
530 Views
Last Modified: 2014-10-20
I have a frame with two choices (checkboxes).  After I set the focus to the frame, I want to test whehter one or the other checkbox is checked.  After I test the condition, I want to disable the unchecked box and set focus to the next frame or text box.

I am getting an error the expression has no value.  Here is my code:

Private Sub Frame50_AfterUpdate()
    If Me.Check53 = True Then
        Me.Check55.Enabled = False
    Else
        Me.Check53.Enabled = False
    End If
   
    Me.Check_162 = False
    Me.Check167 = False
    Me.Check169 = False
    Me.Check_162.SetFocus
End Sub

What is the proper syntax?

Thank you

Glen
0
Comment
Question by:GPSPOW
1 Comment
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
Comment Utility
Are the checkboxes part of your Option Group? If so, and if the user does NOT need to interact with the boxes again, then just disable the Option Group:

Me.Frame50.Enabled = False

BTW: You really should look into proper nameing conventions. Names like "Check53" and such don't mean much, and can be very confusing when you revisit the code. Much better to name them something that is indicative of their meaning. For example, if you have an option group for Customer Type, you might name the checkboxes "ckResidential" and "ckCommercial"
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now