Solved

Testing if checkbox is checked after update on Access Form

Posted on 2014-10-20
1
565 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

726 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