Link to home
Start Free TrialLog in
Avatar of Michael Strauss
Michael Strauss

asked on

How do I make a button that will select all checkmarks and deselect all checkmarks in Access 365

I have 2 tables: Main and States
In my Main form I have a sub form for states. All states are listed and I can check or uncheck any state.
When I create a record in Main, sometime I only need 1 state checked and sometime I need 40 or 48 states checked.
Currently, all states are checked by default. When I create a record that requires only 1 state selected, I have to uncheck 49 of them and it is getting on my nerves.

Is there any way I can create a button that when pressed ALL states are selected or ALL states are un-selected?

In the States table, each state has its own field and the name is the abbreviation (CA=California, etc..)

Thanks

Mike
Avatar of PatHartman
PatHartman
Flag of United States of America image

You actually need THREE tables.
Main, States, and MainStates where the States per "main" are stored.  MainStates is frequently referred to as a junction table since it is used to implement the many-to-many relationship between two other tables.   Sounds like you have a multi-value field in your Main table.  This may seem like a good idea now but you will ultimately find it to be more trouble than it is worth once you attempt to use the multi-value field in queries and code.

Since I wouldn't use an MVF it you held a shotgun to my head, I can't offer a solution but if you are willing to switch, I can help with that.
Avatar of Michael Strauss
Michael Strauss

ASKER

Thanks for the comment, but that doesnt answer my question.
You have the default set to checked.  change the default to unchecked.  Of course you will then have the opposite problem.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.