Updating a table's yes/no field based on another table (1 Viewer)

max117

New member
Local time
Today, 11:27
Joined
Jul 13, 2018
Messages
2
Hi,

I'm new to Access so the question below might be better stated:

I'm trying to update the yes/no field from one table containing a list of members based on whether their last name appears on another table. If their name is in the other table then I want the cell corresponding to them to be checked and if not unchecked.

Is this possible?
 

Ranman256

Well-known member
Local time
Today, 14:27
Joined
Apr 9, 2015
Messages
4,337
Yes, make an update query,
Join the 2 tables on the like field, set any criteria,
Set field= true
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:27
Joined
Feb 19, 2002
Messages
43,257
If some of the rows might already be checked, you need to run an update query FIRST to clear the existing values and then run the query suggested by Ranman256.

However, as I hope you can see, storing a value (the checkbox) that can be calculated is dangerous. You should base any actions on a query that uses a Left Join. The Left Join will return all rows in the main table plus any matching rows in the second table. If the ID field of the second table is not null, the record is in both tables. If the ID is null, the record is only in the main table.
 

max117

New member
Local time
Today, 11:27
Joined
Jul 13, 2018
Messages
2
Ranman256 and Pat,

Your advice worked perfectly! Thank you for all the help.

Max
 

Users who are viewing this thread

Top Bottom