radio-button style checkboxes in a table?

E

Edward Scott

I am new to Access, and was hoping someone might be able to guide me.

I have a table in my database listing people's IDs. Each person might
have more than one ID, so I would like to be able to identify a default
ID for each person. This is simple enough, I added a field named
'Default?' with a 'Yes/No' value that displays a checkbox. When I open
up the table I see a checkbox that I can use to indicate the default
ID.

Ideally I would be able to restrict this so that each user has at most
one default ID. i.e. when I click the 'Default?' checkbox for an entry,
all other 'Default?' checkboxes for entries with the same name will be
deselected.

Come to think of it, it also be nice if I could require exactly one
default ID per person -- i.e. if the user tries to save the table but
there exist some entries with the same name none of which have the
'Default?' checkbox selected, it will warn the user and prevent them
from saving.

Are these things possible? If so, how would I go about executing these
things? Please note that I am talking about a table here, and not a
form. When I try to google search this all I get is help about forms.
 
J

John Vinson

I am new to Access, and was hoping someone might be able to guide me.

I have a table in my database listing people's IDs. Each person might
have more than one ID, so I would like to be able to identify a default
ID for each person. This is simple enough, I added a field named
'Default?' with a 'Yes/No' value that displays a checkbox. When I open
up the table I see a checkbox that I can use to indicate the default
ID.

Don't open a Table for data editing AT ALL. Tables are designed for
data storage, and are not nearly as flexible, friendly, or
programmable as Forms.
Ideally I would be able to restrict this so that each user has at most
one default ID. i.e. when I click the 'Default?' checkbox for an entry,
all other 'Default?' checkboxes for entries with the same name will be
deselected.

Come to think of it, it also be nice if I could require exactly one
default ID per person -- i.e. if the user tries to save the table but
there exist some entries with the same name none of which have the
'Default?' checkbox selected, it will warn the user and prevent them
from saving.

Are these things possible? If so, how would I go about executing these
things? Please note that I am talking about a table here, and not a
form. When I try to google search this all I get is help about forms.

That's because they are the appropriate tool for what you are trying
to accomplish. You can do it with Forms; you cannot do it with Tables.
Simple as that.

Note that if each person may have several ID's, then you need two
tables (using a Form with a Subform); you cannot store multiple values
in one field, and you absolutely SHOULD not store multiple ID fields
in a table.

John W. Vinson[MVP]
 

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