Checkboxes in Access

V

vthokiesvt

I would like to add check boxes to my Access database.
It appears the best way to do this is to make the data type of the
field
to be yes/no. What I want to do though is to have only one column
selectable. So if I have col1, col2 and col3 as yes/no only one can be
chosen at any given time. If col1 is checked and the user selects col2
then col1 should uncheck.

Is this possible in Access? I have tried using the expression builder
like: [Col1] Or [Col2] Or [Col3]
but this does not seem to work as more than one column can still be
selected.

Any help would be appreciated. Thanks in advance.
 
R

Rick Brandt

I would like to add check boxes to my Access database.
It appears the best way to do this is to make the data type of the
field
to be yes/no. What I want to do though is to have only one column
selectable. So if I have col1, col2 and col3 as yes/no only one can
be chosen at any given time. If col1 is checked and the user selects
col2 then col1 should uncheck.

Is this possible in Access? I have tried using the expression builder
like: [Col1] Or [Col2] Or [Col3]
but this does not seem to work as more than one column can still be
selected.

Any help would be appreciated. Thanks in advance.

When you have exclusive choices the proper thing to do is have ONE field in
the table then use Radio Buttons in an OptionGroup frame on your form. The
one field will then contain a 1, 2, 3, etc., depending on the RadioButton
chosen.
 
V

vthokiesvt

Rick and Karl, thanks for the reply.
What I didn't mention is that I want this to go into a datagrid control
on a c# form. As far as I know with limited database knowledge, I
would
need to create the table as a Tables object in access. This way I can
get the
table into c# as a datagrid.

Or am I missing something and the Forms object gets mapped to a Tables
object
in Access?

Thanks again.



KARL said:
What you want is a form with an 'Option Group' to select the checkboxes. The
table would have a number - integer field.

Lookup Option Group in the Help.

I would like to add check boxes to my Access database.
It appears the best way to do this is to make the data type of the
field
to be yes/no. What I want to do though is to have only one column
selectable. So if I have col1, col2 and col3 as yes/no only one can be
chosen at any given time. If col1 is checked and the user selects col2
then col1 should uncheck.

Is this possible in Access? I have tried using the expression builder
like: [Col1] Or [Col2] Or [Col3]
but this does not seem to work as more than one column can still be
selected.

Any help would be appreciated. Thanks in advance.
 
R

Rick Brandt

Rick and Karl, thanks for the reply.
What I didn't mention is that I want this to go into a datagrid
control on a c# form. As far as I know with limited database
knowledge, I would
need to create the table as a Tables object in access. This way I can
get the
table into c# as a datagrid.

Or am I missing something and the Forms object gets mapped to a Tables
object
in Access?

I cannot comment on what GUI tools are available to you in a non-Access
interface. Only that multiple columns holding Yes/No data where you want
the "Yes" to be mutually exclusive is incorrect strictly from a database
table design aspect. The "Yes" being mutually exclusive means that you are
describing a single attribute that can have one of many values.

For example a class scheduling table would not have fields Classroom1,
Classroom2, Classroom3, etc., with only one field containing a value of
"Yes". It would have a single field [Classroom] with "Classroom1" stored in
it or an ID that represented "Classroom1".
 

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