Solved

Testing if checkbox is checked after update on Access Form

Posted on 2014-10-20
1
553 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
ID: 40392584
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

815 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

13 Experts available now in Live!

Get 1:1 Help Now