Mutually Exclusive Check Boxes

Creating tables and queries
Post Reply
Mickey12
Posts: 75
Joined: Thu Apr 16, 2020 3:07 pm

Mutually Exclusive Check Boxes

Post by Mickey12 »

Hi all
I have a table with a field Name "subscribed"
Type Yes/No
It is a check box in a form
Default unchecked

I am trying to add another field Name "unsubscribed"
Type Yes/No
Also a check box in a form.
Default unchecked.

I wish to prevent both boxes being simultaneously checked
ie if one is checked, then it must be unchecked before the other on can be checked.

I hope that makes sense.

Thanks
Open Office 4.1.7 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Mutually Exclusive Check Boxes

Post by RoryOF »

Possibly in place of checkboxes, use Radio buttons.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
robleyd
Moderator
Posts: 5056
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Mutually Exclusive Check Boxes

Post by robleyd »

Alternatively, and better, one field for subscription status and a pair of radio buttons Yes and No. Store as true/false if your database supports a boolean field, or Y/N, or Yes/No or whatever.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
Post Reply