469,353 Members | 2,101 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,353 developers. It's quick & easy.

How do I check to see if a checkbox is checked or unchecked in Micross Access?

I have a Microsoft Access form. On the form I have CheckBox controls in various groups. I would like to know how to communicate with a specific checkbox in a group to know if it's checked or unchecked.

Thanks,

Edge
Sep 20 '10 #1
4 15429
munkee
374 256MB
When you say grouped do you mean they are checkboxes within an option group control?

Actually I remember seeing a tutorial which was quite good at explaining all this which I have found out again:

http://www.datapigtechnologies.com/f...iongroups.html It shows you how to setup the control but also how to communicate to see which has been checked.
Sep 20 '10 #2
reginaldmerritt
201 100+
Each Check Box within a Option Group has a value. First Check box is 1, Second Check Box is 2 and so on

To check the value of a Check Box within a Option Group

Expand|Select|Wrap|Line Numbers
  1. If Me.NameOfOptionBox = 1 Then 
  2. MsgBox("Check Box 1 = True")
  3. End If
  4.  
To check the value of a Check Box not in an Option Group

Expand|Select|Wrap|Line Numbers
  1. If Me.NameOfCheckBox = True Then
  2. MsgBox("Check Box = True")
  3. End If
  4.  
Reg
Sep 20 '10 #3
munkee
374 256MB
I would use select case for a set of checkboxes in an option group it just looks a lot cleaner than using if statements.

E.g.

Expand|Select|Wrap|Line Numbers
  1. Select case me.optiongroupname
  2.  
  3. Case 1 
  4. msgbox "1 selected"
  5. Case 2
  6. msgbox "2 selected"
  7. Case 3
  8. msgbox "3 selected"
  9. Case else
  10. msgbox "no selection made"
  11. End select
Sep 20 '10 #4
NeoPa
32,184 Expert Mod 16PB
You can always refer to a CheckBox control on a form by its name.

If it is within an Option Group you have another alternative. To see the currently selected CheckBox you can also check the value of the OptionGroup control itself. Remember though, CheckBoxes within OptionGroups behave like RadioButtons rather than normal CheckBoxes, in as much as only one may be selected at any one time.

This can be confusing to operators so should be used very carefully.
Sep 20 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Targa | last post: by
4 posts views Thread by Visual Systems AB \(Martin Arvidsson\) | last post: by
2 posts views Thread by Matthew Louden | last post: by
4 posts views Thread by RodBillett | last post: by
9 posts views Thread by morellik | last post: by
3 posts views Thread by nologo | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.