Only select 1 option out of 4

User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Only select 1 option out of 4

Post by burrina »

I have 4 checkboxes and want the user to only be able to select one of them.
if they choose one then the other ones will not be available.

Here are the names of those checkboxes;

dev
admn
sprvsr
data
reado

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Only select 1 option out of 4

Post by HansV »

Create an option group, and create option buttons in that option group. They will automatically be mutually exclusive.
Each option button will have an Option Value - by default, Access will assign 1, 2, 3, ..., but you can specify your own values if you wish.
When the user clicks one of the option buttons, the others will automatically be turned off, and the Value of the option group will be the Option Value of the selected option button.

Pic.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Re: Only select 1 option out of 4

Post by burrina »

Yes, I tried that but must have made a mistake on what to bind it too since it caused me many problems.

User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Re: Only select 1 option out of 4

Post by burrina »

Ok, got it.
Thanks,

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Only select 1 option out of 4

Post by HansV »

I composed this while you posted another reply:

You can't set the Control Source if you create the option buttons in the option group.
You can set the Control Source of the option group if you want to store the Option Value of the selected option button in a table.
In the screenshot in my previous reply, it would store 1 for "dev", 2 for "admin", 3 for "sprvsr" etc.
But you're not required to do so - you can leave the Control Source blank and use the value of the option group in your code.
Best wishes,
Hans