A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Assigning 1/0 to yes/no



 
 
Thread Tools Display Modes
  #1  
Old September 28th, 2006, 04:04 PM posted to microsoft.public.access.forms
colesterg
external usenet poster
 
Posts: 3
Default Assigning 1/0 to yes/no

Is there a way to assign a value of 1/0 for yes/no, respectively?
  #2  
Old September 28th, 2006, 04:13 PM posted to microsoft.public.access.forms
Al Campagna
external usenet poster
 
Posts: 421
Default Assigning 1/0 to yes/no

Cole,
Not sure why that would be necessary but...
Normally a Boolean True/False or Yes/No field yields a -1 for True and 0 for False.
Abs(YourBooleanField) would yield either1 or 0.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"colesterg" wrote in message
...
Is there a way to assign a value of 1/0 for yes/no, respectively?



  #3  
Old September 28th, 2006, 04:24 PM posted to microsoft.public.access.forms
David F Cox
external usenet poster
 
Posts: 493
Default Assigning 1/0 to yes/no

If you tell us why you are more likely to learn something.

If you are trying to add up "Yes" answers
-sum([my_yn])


% of yes answers:
- avg(my_yn)*100

"Al Campagna" wrote in message
...
Cole,
Not sure why that would be necessary but...
Normally a Boolean True/False or Yes/No field yields a -1 for True and 0
for False.
Abs(YourBooleanField) would yield either1 or 0.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"colesterg" wrote in message
...
Is there a way to assign a value of 1/0 for yes/no, respectively?






  #4  
Old September 28th, 2006, 05:20 PM posted to microsoft.public.access.forms
colesterg
external usenet poster
 
Posts: 3
Default Assigning 1/0 to yes/no

Well, I want the combo box to say yes/no so I wont confuse anyone, but I want
it to store this data numerically, not as a yes/no.

"David F Cox" wrote:

If you tell us why you are more likely to learn something.

If you are trying to add up "Yes" answers
-sum([my_yn])


% of yes answers:
- avg(my_yn)*100

"Al Campagna" wrote in message
...
Cole,
Not sure why that would be necessary but...
Normally a Boolean True/False or Yes/No field yields a -1 for True and 0
for False.
Abs(YourBooleanField) would yield either1 or 0.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"colesterg" wrote in message
...
Is there a way to assign a value of 1/0 for yes/no, respectively?







  #5  
Old September 28th, 2006, 05:31 PM posted to microsoft.public.access.forms
Yaacov Klapisch
external usenet poster
 
Posts: 33
Default Assigning 1/0 to yes/no

the Yes/No type is (minus) -1 and 0
If you want to use a ComboBox, you can set the field as numeric and not
Yes/No and Row Source Type as Value list, Columns = 2, Bound column = 1,
Column Width = 0;5 and the Row Source = 0;"No";1;"Yes"

"colesterg" wrote in message
...
Is there a way to assign a value of 1/0 for yes/no, respectively?



  #6  
Old September 28th, 2006, 07:14 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Assigning 1/0 to yes/no

A combo box is really not the right type of control to use for this purpose.
I would suggest an Option group with two toggle buttons. Make the caption of
one button Yes and its Option Value -1. Make the other No and 0

The option group control will return the value of the selected button.
You could make True = 1, but since the Boolean data type exists soley for
binary situations, why not use it?

"colesterg" wrote:

Well, I want the combo box to say yes/no so I wont confuse anyone, but I want
it to store this data numerically, not as a yes/no.

"David F Cox" wrote:

If you tell us why you are more likely to learn something.

If you are trying to add up "Yes" answers
-sum([my_yn])


% of yes answers:
- avg(my_yn)*100

"Al Campagna" wrote in message
...
Cole,
Not sure why that would be necessary but...
Normally a Boolean True/False or Yes/No field yields a -1 for True and 0
for False.
Abs(YourBooleanField) would yield either1 or 0.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"colesterg" wrote in message
...
Is there a way to assign a value of 1/0 for yes/no, respectively?






  #7  
Old September 28th, 2006, 07:33 PM posted to microsoft.public.access.forms
John Vinson
external usenet poster
 
Posts: 4,033
Default Assigning 1/0 to yes/no

On Thu, 28 Sep 2006 09:20:01 -0700, colesterg
wrote:

Well, I want the combo box to say yes/no so I wont confuse anyone, but I want
it to store this data numerically, not as a yes/no.


Use a two-column combo box, with the visible column containing "Yes"
and "No", and the bound column containing 1 and 0.

John W. Vinson[MVP]
  #8  
Old October 2nd, 2006, 04:54 PM posted to microsoft.public.access.forms
colesterg
external usenet poster
 
Posts: 3
Default Assigning 1/0 to yes/no

It worked! Thank you!

"John Vinson" wrote:

On Thu, 28 Sep 2006 09:20:01 -0700, colesterg
wrote:

Well, I want the combo box to say yes/no so I wont confuse anyone, but I want
it to store this data numerically, not as a yes/no.


Use a two-column combo box, with the visible column containing "Yes"
and "No", and the bound column containing 1 and 0.

John W. Vinson[MVP]

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.