Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Format of "Checkbox" (simplest question)


Message #1 by LoonieVisa@h... on Wed, 28 Aug 2002 17:58:46
When I first open my form, the checkbox is "gray."  If check the box, it 
turns "white."  Then, when I uncheck the box, it remains "white."  
Is it possible to have the checkbox return to gray when it's unchecked? Or 
have it in one color?


Thank you for all help!

Rick N
Message #2 by "Gerald, Rand" <RGerald@u...> on Wed, 28 Aug 2002 12:24:22 -0500
The difference in the colors is as follows:

Gray - Null Data
Checked White - True
Unchecked White - False

You can force the boxes to always be White if you set the default value 
in
the field to False instead of Null.  You may need to set the default at 
the
table level instead of the form level.

Rand E Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston IL 60201
(xxx) xxx-xxxx

-----Original Message-----
From: LoonieVisa@h... [mailto:LoonieVisa@h...]
Sent: Wednesday, August 28, 2002 12:59 PM
To: Access
Subject: [access] Format of "Checkbox" (simplest question)

When I first open my form, the checkbox is "gray."  If check the box, 
it
turns "white."  Then, when I uncheck the box, it remains "white."
Is it possible to have the checkbox return to gray when it's unchecked? 
Or
have it in one color?


Thank you for all help!

Rick N
Message #3 by "Darin Wray" <darin@r...> on Wed, 28 Aug 2002 13:02:26 -0500
The property that controls this default behaviour of the check box is called
Triple State.  The default is set to yes...and when it is, there are three
possiblities for the value in a checkbox...null, true, false.  It's my
opinion a checkbox should never have a null value...it's either true or it's
false.  You can change the Triple State property to No...and that will get
rid of the Null possiblity.  For all my checkboxes, I usually go ahead and
set what I want my default value to be, as well...either True or False....0
or -1(1 in SQL).

Darin


----- Original Message -----
From: <LoonieVisa@h...>
To: "Access" <access@p...>
Sent: Wednesday, August 28, 2002 5:58 PM
Subject: [access] Format of "Checkbox" (simplest question)


> When I first open my form, the checkbox is "gray."  If check the box, it
> turns "white."  Then, when I uncheck the box, it remains "white."
> Is it possible to have the checkbox return to gray when it's unchecked? Or
> have it in one color?
>
>
> Thank you for all help!
>
> Rick N
>

Message #4 by John Fejsa <John.Fejsa@h...> on Thu, 29 Aug 2002 08:55:56 +1000
The checkbox is grey because it does not contain any value, it's NULL.

As soon as you click the checkbox it stores either a TRUE or FALSE value.  It will normally not go back to NULL.

For example: 
                  When you check it it becomes selected (contains value of TRUE)
                  When you unchecked if becomes unselected (conains value of FALSE)

You can make it greay it out again by actually forcing it to become NULL, ie,;

              If Me!MyCheckBox = False Then
                           Me!MyCheckBox = Null
              End If

However, question I have for you is why would you do something like that?  It's not a standard Windows or programming practice and
your users would not expect it to happen that way either.  So why do it?  Just wondering...

____________________________________________________

John Fejsa
Systems Analyst/Computer Programmer
Hunter Centre for Health Advancement
Locked Bag 10, WALLSEND NSW 2287
Phone: (02) 4924 6336 Fax: (02) 4924 6209
www.hcha.org.au
____________________________________________________

The doors we open and close each day decide the lives we live
____________________________________________________

CONFIDENTIALITY & PRIVILEGE NOTICE
The information contained in this email message is intended for the named addressee only.  If you are not the intended recipient you
must not copy, distribute, take any action reliant on, or disclose any details of the information in this email to any other person
or organisation.  If you have received this email in error please notify us immediately.

>>> LoonieVisa@h... 29/08/2002 3:58:46 >>>
When I first open my form, the checkbox is "gray."  If check the box, it 
turns "white."  Then, when I uncheck the box, it remains "white."  
Is it possible to have the checkbox return to gray when it's unchecked? Or 
have it in one color?


Thank you for all help!

Rick N

Message #5 by John Fejsa <John.Fejsa@h...> on Thu, 29 Aug 2002 09:25:25 +1000
** PRIVATE **

Hi Rick,

Sorry I did not fully complete the last email before pressing send button.  You second question (how to make them apper in the same
colour) is easy to answer. Just make the checkbox defult to either True or False.

If your checkbox is linked to data in the table.
===================================
Open required table in desing mode 
Click on the field which is a Control Source for you form checkbox
In the Defaul Value box either type TRUE or FALSE depending which is more appropriate for your application. 

However, if you use unbound checkbox (not conected to a value in a table) you will either have to set the checkbox to TRUE or FALSE
on FormOpen to stop it from showing grey (NULL) value when the form opens.

For example:

Private Sub Form_Open(Cancel As Integer)
    Me!MyCheckBox = False
End Sub

Hope that makes sense...



____________________________________________________

John Fejsa
Systems Analyst/Computer Programmer
Hunter Centre for Health Advancement
Locked Bag 10, WALLSEND NSW 2287
Phone: (02) 4924 6336 Fax: (02) 4924 6209
www.hcha.org.au
____________________________________________________

The doors we open and close each day decide the lives we live
____________________________________________________

CONFIDENTIALITY & PRIVILEGE NOTICE
The information contained in this email message is intended for the named addressee only.  If you are not the intended recipient you
must not copy, distribute, take any action reliant on, or disclose any details of the information in this email to any other person
or organisation.  If you have received this email in error please notify us immediately.

>>> John.Fejsa@h... 29/08/2002 8:55:56 >>>
The checkbox is grey because it does not contain any value, it's NULL.

As soon as you click the checkbox it stores either a TRUE or FALSE value.  It will normally not go back to NULL.

For example: 
                  When you check it it becomes selected (contains value of TRUE)
                  When you unchecked if becomes unselected (conains value of FALSE)

You can make it greay it out again by actually forcing it to become NULL, ie,;

              If Me!MyCheckBox = False Then
                           Me!MyCheckBox = Null
              End If

However, question I have for you is why would you do something like that?  It's not a standard Windows or programming practice and
your users would not expect it to happen that way either.  So why do it?  Just wondering...

____________________________________________________

John Fejsa
Systems Analyst/Computer Programmer
Hunter Centre for Health Advancement
Locked Bag 10, WALLSEND NSW 2287
Phone: (02) 4924 6336 Fax: (02) 4924 6209
www.hcha.org.au
____________________________________________________

The doors we open and close each day decide the lives we live
____________________________________________________

CONFIDENTIALITY & PRIVILEGE NOTICE
The information contained in this email message is intended for the named addressee only.  If you are not the intended recipient you
must not copy, distribute, take any action reliant on, or disclose any details of the information in this email to any other person
or organisation.  If you have received this email in error please notify us immediately.

>>> LoonieVisa@h... 29/08/2002 3:58:46 >>>
When I first open my form, the checkbox is "gray."  If check the box, it 
turns "white."  Then, when I uncheck the box, it remains "white."  
Is it possible to have the checkbox return to gray when it's unchecked? Or 
have it in one color?


Thank you for all help!

Rick N




  Return to Index