Q:

Update specific table column with select query data MS Access

I'm using MS Access 2019 and ahve two tables:

table_a (id_a, number_a)
table_b (id_b, name_b)

This UPDATE statement doesn't work:
UPDATE table_a
SET number_a = (SELECT COUNT(*) FROM table_b WHERE id_b IN (1,3) AND name_b=@name) 
WHERE id_a=1;

Error 

Operation must use an updateable query

A:

UPDATE table_a 
SET table_a.number_a = DCount("*","table_b","id_b IN (1,3) AND name_b=@name")
WHERE table_a.id_a=1;

or 
UPDATE table_a 
SET table_a.number_a = DCount("*","table_b","id_b IN (1,3) AND name_b=" & @name)
WHERE table_a.id_a=1;

depends on what is @name, where it is defined and how it is substituted with its value.

