Simple Checkbox Question

M

Mary

Hello,

I have a checkbox on a form (i know very little about
checkboxes) and I wanted it to be unchecked, so i set
triple state to yes. Although id perfer only 2
states "checked/unchecked" because I dont really know
what the third state does. With that, how do i identify
what state the checkbox is in (used for if structure etc)
Thanks

Mary
 
S

Sullivan

Hey Mary

The easiest way to actually to get what you seem to want
is by using an Option Group. If you use the Wizard when
creating it, it'll ask you what you want to label each
check box, whether or not you want a default (one option
chosen when the form is opened), what value to set each
check box to, and then what you want it to look like.

What this does is that one and only one option can be
chosen at any given time. So, if you did one label "Yes",
and the other "No", each would be assigned a numeric value
(let's say, Yes = 1 and No = 2) so that if Yes is chosen,
the OptionGroupValue = 1, and if No is chosen, the
OptionGroupValue = 2.

Hope this helps!

Sullivan
 
M

Mary

Sull,

I know the basics of checkboxes, but in this case, i ONLY
want 1 checkbox, checked/unchecked. and id like to know
the property to see if the checkbox is checked (even if
its in an option group) ie:

if checkbox.checked = true then.....

if checkbox.checked = false then..

ya know?

Mary
 
F

Fredg

Mary,
I assume this check box is unbound.
It seems to me that if you want the form to open with
the Checkbox unchecked, just set the check box
default property to 0 (or False, or No, or Off),
and Triple State No.

Then you can read it in an event on the form
to determine if it's been changed to -1 (or True, or Yes, or Off):

If [Checkfield] = 0 Then
' it's unchecked
Else
' It's checked
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top