2016-11-16 77 views
0

我在Access數據庫中有一個名爲「tbl_Update」的選擇查詢和一個名爲「tbl_A」的表。我想按下一個按鈕,這會產生以下結果: 在字段「KW」中查找,當它們匹配時(在下面的示例中,值「2016.45」匹配),則插入「tbl_update.CA041073p」的值「變成」tbl_A.CA041073p「。似乎很容易,但總是會犯錯。任何簡單的解決方案如何去做?謝謝!通過按下按鈕將值從一個表插入另一個表

我的代碼是下面的,它是給我的錯誤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

+0

您需要發佈一些代碼或SQL。 – Fionnuala

+0

嗨。我添加了我的錯誤代碼。 – Toli

+0

它適合我。你沒有展示完整的情況。這可能會給你一些線索http://stackoverflow.com/questions/170578/operation-must-use-an-updatable-query-error-3073-microsoft-access – Fionnuala

回答

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. 
+0

數據庫文件位於SharePoint中,並且我具有讀寫權限。也許發生錯誤3037與查詢的類型。因爲我在沒有「Where」子句的情況下嘗試了它,代碼工作正常,但我必須將此子句作爲我的標準。 – Toli

相關問題