473,473 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

1 New Member
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 16684
munkee
374 Contributor
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 New Member
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 Contributor
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,556 Recognized Expert Moderator MVP
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

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

Similar topics

4
by: Targa | last post by:
I have a form in which I want to have an button(image) displayed next to a checkbox when it is checked. If the box is unchecked, the button should disappear. How can I do this? Thanks!
4
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! How do I convert a CheckBox.Checked to an int? Regards Martin Arvidsson
6
by: AFN | last post by:
I want to click a checkbox and have a 4 line (approx) paragraph appear beneath the checkbox, pushing the rest of the page down. And when unchecking the checkbox, the paragraph should disappear...
2
by: Matthew Louden | last post by:
For the following code, I dont understand why "no" never appears even I uncheck the check in the check box. Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As...
4
by: RodBillett | last post by:
I have a situation where I have 3 checkboxes - and at least 1 needs to be selected at all times... I have implemented the code that allows this behavior to happen, BUT Viewstate gets all messed...
2
by: Andrew | last post by:
Hi, I have a problem capturing the checkboxes that are checked, I get false irrespective of wether they are checked or not. I have gone thru the sample code on this forum, but they dun seem to...
9
by: morellik | last post by:
Dear all, I have a program that creates dinamically a web page. In the page I have the following function to check how many checkbox are checked. function tarInfo(info) { var i=0; var c=0;...
0
by: sk27ahmed | last post by:
Hi Any one can show me how to access datagridview column value on column checked unchecked. I create one column in datagridview of type checkbox,and on button click i write code to select all...
3
by: nologo | last post by:
All, Have a problem i just cant find the answer for. I'm trying to populate a colum in a SQL database. Basically the column requires a 1 or 0. I'm trying to populate this col via a c#...
4
by: PeterVR | last post by:
Hello I'm not a programmer. I'm afraid my question will be hilariously easy to ASP.NET programmers. Actually, I hope it will be. Please help. In a .aspx file I'm trying to have a checkbox checked...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.