0

I have a select query called "tbl_Update" and a table called "tbl_A" in Access DB. I would like to press on on a button, which makes the following: looks in fields "KW" and when they match (in this example below, the value "2016.45" are matching), then insert the value of "tbl_update.CA041073p" into "tbl_A.CA041073p". Seems to be very easy, but getting always Errors to do it. Any simple solutions how to do it? Thanks!

My code is the following and it is giving me the Error 3037:

Public Function Update()

 DoCmd.RunSQL "Update tbl_A INNER JOIN tbl_Update " & _ 
 "ON tbl_A.KW = tbl_Update.KW " & _ 
 "SET tbl_A.CA041073p = [tbl_Update].[CA041073p] "

End Function

enter image description here

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Toli
  • 109
  • 1
  • 4
  • 13
  • You need to post some code or sql. – Fionnuala Nov 16 '16 at 15:54
  • Hi. I added my code which is giving an error. – Toli Nov 16 '16 at 19:21
  • It works for me. You have not shown the full situation. This may give you some clues http://stackoverflow.com/questions/170578/operation-must-use-an-updatable-query-error-3073-microsoft-access – Fionnuala Nov 16 '16 at 21:54
  • I am not sure what I have to show more. Maybe, my select query "tbl_Update" has a "WHERE" clause, is this the case? (as I somehow understood from the link you sent me). But the query is working perfectly. If so, i would much appreciate if you could tell me how to solve it. – Toli Nov 17 '16 at 10:09

1 Answers1

0
One quite likely reason is that the user running the program doesn't have read-write access to the database file, especially if it is located in program files folder.

So check the directory and file permissions and modify them if needed. You can also consider changing the location of the database file to another, more easily accessible folder.
Poonam
  • 669
  • 4
  • 14
  • The DB file is in SharePoint, and I have a read-write access to it. The error 3037 is occuring maybe with type of the query. Because I tried it without "Where" Clause, the code working fine, but I have to put this clause as my criteria. – Toli Nov 17 '16 at 10:36