PC Review


Reply
Thread Tools Rate Thread

Default settings for check boxes

 
 
Pat Briggs
Guest
Posts: n/a
 
      28th Apr 2009
I need to be able to change the default setting for check boxes from -1 to 1
(or something else). Is there an easy way to do this? I'm not real
comfortable with VBA programming so keep it simple for me, please?
 
Reply With Quote
 
 
 
 
M Skabialka
Guest
Posts: n/a
 
      28th Apr 2009
In Design view in your table, set the default value to a value of 0 for
False, Off, No, etc, or -1 for True, On, Yes
1 is not an option.
Mich

"Pat Briggs" <(E-Mail Removed)> wrote in message
news:7BC96318-FBF5-4AD4-B405-(E-Mail Removed)...
>I need to be able to change the default setting for check boxes from -1 to
>1
> (or something else). Is there an easy way to do this? I'm not real
> comfortable with VBA programming so keep it simple for me, please?



 
Reply With Quote
 
Ken Sheridan
Guest
Posts: n/a
 
      28th Apr 2009
It could be done if you change the data type of the column to an integer
number. Then in a form put the following code in the AfterUpdate event
procedure of a check box bound to the column:

Dim ctrl As Control

Set ctrl = Me.ActiveControl

ctrl = Abs(ctrl)

This will set the value to 1 if its currently 0 and vice versa.

In the table design set the column's Required property to True (Yes) and its
DefaultValue property to 0.

Even though Access implements Boolean values as 0 and -1 the values of 0 and
1 in the column will still be recognized as Boolean FALSE or TRUE because a
TRUE is determined by virtue of being NOT FALSE, so any non-zero value is
TRUE. If you assign a Boolean TRUE to the column by means of code or an SQL
statement, however, the underlying value assigned would be -1, not 1 so if
doing this be sure to assign a value of 1 rather than TRUE.

Ken Sheridan
Stafford, England

"Pat Briggs" wrote:

> I need to be able to change the default setting for check boxes from -1 to 1
> (or something else). Is there an easy way to do this? I'm not real
> comfortable with VBA programming so keep it simple for me, please?



 
Reply With Quote
 
 
 
Reply

« panne | Menu system »
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Yes/No Check Boxes - Default Value adrian007uk Microsoft Access Form Coding 2 25th Aug 2009 10:06 PM
Can I change default check boxes on protect sheet? DWAyers Microsoft Excel Misc 1 4th Feb 2008 06:00 PM
Default settings for text boxes =?Utf-8?B?UmFuZHkgUGVyc29u?= Microsoft Powerpoint 0 10th Apr 2007 09:08 PM
Check Boxes on click and default value please help Jeremy0028 Microsoft Access 0 7th Aug 2005 08:57 PM
Using Check boxes to set a 'Default' value =?Utf-8?B?Tmlr?= Microsoft Access Forms 4 9th Jun 2004 11:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:53 PM.