Checkbox values

P

Paul Milner

Hi
Can a checkbox have any other value other than
yes/no /on/off etc. in other words can it be more
discriptive like if I had a form catagory called gender
and someone clicked the female checkbox can the
resulting entry in the table say female.
I would like this so when I do a query the result says
female instead of yes.
Or is it best done in the query SQL with some kind of
alias, if so how?
Thankyou
Paul M
 
F

fredg

Hi
Can a checkbox have any other value other than
yes/no /on/off etc. in other words can it be more
discriptive like if I had a form catagory called gender
and someone clicked the female checkbox can the
resulting entry in the table say female.
I would like this so when I do a query the result says
female instead of yes.
Or is it best done in the query SQL with some kind of
alias, if so how?
Thankyou
Paul M

Regarding >someone clicked the female checkbox <

Since the choices are either Male or Female, perhaps the field should
more correctly be called 'Gender' with a Check mark meaning female
and blank meaning male (or vice versa).

A Check Box value is either 0 or -1.
That is the value that is stored.
You can use an unbound control to display any text you wish, on a form
or in a report, instead of 0 or -1.

Use an unbound text control.
Set it's control source to the Check Box field.
Set it's Format property to:
;"Female";"Male"

In a query, you would create another column:
Gender:IIf([CheckBoxField]=-1,"Female","Male")
 
G

Guest

Thanks Fred
Re. the unbound control, where is the format property
option
Best wishes
Paul M
-----Original Message-----
Hi
Can a checkbox have any other value other than
yes/no /on/off etc. in other words can it be more
discriptive like if I had a form catagory called gender
and someone clicked the female checkbox can the
resulting entry in the table say female.
I would like this so when I do a query the result says
female instead of yes.
Or is it best done in the query SQL with some kind of
alias, if so how?
Thankyou
Paul M

Regarding >someone clicked the female checkbox <

Since the choices are either Male or Female, perhaps the field should
more correctly be called 'Gender' with a Check mark meaning female
and blank meaning male (or vice versa).

A Check Box value is either 0 or -1.
That is the value that is stored.
You can use an unbound control to display any text you wish, on a form
or in a report, instead of 0 or -1.

Use an unbound text control.
Set it's control source to the Check Box field.
Set it's Format property to:
;"Female";"Male"

In a query, you would create another column:
Gender:IIf([CheckBoxField]=-1,"Female","Male")

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
F

fredg

Thanks Fred
Re. the unbound control, where is the format property
option
Best wishes
Paul M
-----Original Message-----
Hi
Can a checkbox have any other value other than
yes/no /on/off etc. in other words can it be more
discriptive like if I had a form catagory called gender
and someone clicked the female checkbox can the
resulting entry in the table say female.
I would like this so when I do a query the result says
female instead of yes.
Or is it best done in the query SQL with some kind of
alias, if so how?
Thankyou
Paul M

Regarding >someone clicked the female checkbox <

Since the choices are either Male or Female, perhaps the field should
more correctly be called 'Gender' with a Check mark meaning female
and blank meaning male (or vice versa).

A Check Box value is either 0 or -1.
That is the value that is stored.
You can use an unbound control to display any text you wish, on a form
or in a report, instead of 0 or -1.

Use an unbound text control.
Set it's control source to the Check Box field.
Set it's Format property to:
;"Female";"Male"

In a query, you would create another column:
Gender:IIf([CheckBoxField]=-1,"Female","Male")

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

Same place it is on a bound text control.
Display the control's property sheet.
Click on the Format tab.
It's the first property.
 

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