Clear Yes/No field in form with a command button (1 Viewer)

JimFlood2424

New member
Local time
Today, 06:00
Joined
Apr 9, 2020
Messages
4
I have a Yes/No field in a form for selecting the record. I would like to have a command button that would reset (clear the check mark) in all the records.
Does anyone know if this can be done?
 

June7

AWF VIP
Local time
Today, 03:00
Joined
Mar 9, 2014
Messages
5,472
CurrentDb.Execute "UPDATE table SET field = False"

Is this a multi-user database? Multiple simultaneous users will conflict.
 

tvanstiphout

Active member
Local time
Today, 04:00
Joined
Jan 22, 2016
Messages
222
CurrentDb.Execute "UPDATE table SET field = False"

Is this a multi-user database? Multiple simultaneous users will conflict.
> Is this a multi-user database? Multiple simultaneous users will conflict.
Can you explain that more? What conflict would you expect, and how would you guard against it?
 

June7

AWF VIP
Local time
Today, 03:00
Joined
Mar 9, 2014
Messages
5,472
If multiple users are simultaneously checking and unchecking field in table, they are in conflict and output will be wrong for everyone. Arbitrary selection of records is seldom efficient or practical. Selection is normally based on criteria like date range or zip code, etc. Review http://allenbrowne.com/ser-62.html
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 07:00
Joined
May 21, 2018
Messages
8,529
There are some other approaches for recording selections without requiring a field in a table.
 

Users who are viewing this thread

Top Bottom