how to write this update query in Access 2010

Hello! I have a table1 with field1 and field2 and a table2 with field1. I want to set table1.field2 = 1 where table1.field1 exists in table2.field1. I am getting a syntax error though. Can someone tell me how I would write a query that essentially puts a 1 in field2 where field1 values exist in this other table's field? Thanks
mrosierAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brendt HessSenior DBACommented:
Can you show the query syntax you attempted?
mrosierAuthor Commented:
sure, I had said:

update table1 set field2 = 1 where field1 in (select field1 from table2)
Dale FyeOwner, Dev-Soln LLCCommented:
after making copies of Table1, try:

UPDATE Table1
SET Field2 = 1
WHERE Exists (SELECT 1 FROM Table2 WHERE Table2.Field1 = Table1.Field1)
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Rey Obrero (Capricorn1)Commented:
try this

update table1
inner join table2 on table1.field1=table2.field1
set table1.field2=1
mrosierAuthor Commented:
I found my problem folks, my original query works. I assigned generic names to my tables and columns (which was probably pretty obvious), and the problem is that one of my field names began with a number. once I enclosed that field in [ ] my query worked. I am truly sorry for wasting your time!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mrosierAuthor Commented:
This was the solution that fit me, though the problem was something I didn't think to mention in the original post because I wasn't aware that was the problem. Is this the appropriate way to mark this question? I put an A because that was the exact problem I had.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.