Solved

Testing if checkbox is checked after update on Access Form

Posted on 2014-10-20
1
574 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 85

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

729 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