MS Access更新查询不断询问“参数值". [英] MS Access Update Query Keeps Asking for "Parameter Value"

查看:108
本文介绍了MS Access更新查询不断询问“参数值".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将尽力简化情况... 我与现场服务技术人员团队合作.我们之间共享许多工具和设备,因为SOMEONE不想在我们身上花钱.我正在使用MS Access开发一种方法来跟踪约2000多个项目中谁拥有哪些工具或特定设备.我已经弄清楚了最后一步的过程.它是这样的:

I will try to simplify the situation as best as I can... I work with a team of field service technicians. We share a lot of our tools and equipment between us because SOMEONE doesnt want to spend money on us. I am using MS Access to develope a way to track who has what tool or specific piece of equipment out of a pool of about 2000+ items. I have got the process figured out down to one last step. It gos like this:

  1. Tech将打开一个显示所有2000多个项目的当前位置/所有权的表单,该表单将从SharePoint列表中拉出并插入 本地表.
  2. 技术人员更改了本地表.
  3. 完成技术后,Sharepoint列表将从本地表中更新(这就是我被卡住的地方).
  1. Tech opens a form that shows current location/ownership of all 2000+ items, which is pulled off a SharePoint List and inserted into a local table.
  2. Tech makes changes to local table.
  3. When Tech is done, the Sharepoint List gets updated FROM the local table (This is where I am stuck).

我已经阅读了所有教程,逐步学习并解决了我所能理解的问题.但是每次我运行查询时,Access都会询问我要更新的每个字段的参数值".请注意,我发现的所有内容都显示了一个如何更新表中一个字段的示例.我正在尝试更新每行5个字段.当我让Access为此构建SQL时,它看起来像:

I have followed every tutorial, walk through, and work around that I can understand. But every time I run the Query, Access asks me for the "Parameter Value" of each field I am trying to update. Mind you, everything I have found shows an example of how to update one field in a table. I am trying to update 5 fields per row. When I let Access build the SQL for this it looks like:

UPDATE Table1 INNER JOIN Table2 
ON Table1.[Asset ID] = Table2.[Asset ID] 
SET Table1.Department = Table2.[Department], Table1.[Cal Status] = Table2. 
[Cal Status], Table1.[Return Date] = Table2.[Return Date], Table1.Comments = 
Table2.[Comments], Table1.[Cal Due] = Table2.[Cal Due], Table1.Active = 
Table2.[Active];

字段没有拼写错误,我已经检查并再次检查了.

The fields are not misspelled, I already checked and double checked that.

我已经看到一些有关Access如何在UPDATE中遇到问题的评论.但是我所做的一切都是自学成才的,除非我理解了这一点,否则我无法切换到其他东西.我本周初才刚开始使用Access和SQL,所以请耐心等待.

I have seen some comments about how Access has problems with UPDATE. But I am self taught with everything I do and I cant switch to something else until I understand this. I just started with Access and SQL at the begining of this week, so please be patient with me.

编辑

UPDATE Assets
SET Assets.Department = AssetsSharePoint.[Department],
Assets.[Cal Status]   = AssetsSharePoint.[Cal Status],
Assets.[Return Date]  = AssetsSharePoint.[Return Date],
Assets.Comments       = AssetsSharePoint.[Comments],
Assets.[Cal Due]      = AssetsSharePoint.[Cal Due],
Assets.Active         = AssetsSharePoint.[Active]
FROM Assets
INNER JOIN AssetsSharePoint ON Assets.[Asset ID] = AssetsSharePoint.[Asset 
ID];

这给我一个语法错误.缺少运算符",然后突出显示FROM

This gives me a "Syntax Error. Missing Operator" Then Highlights FROM

编辑2

如果我将其缩减为1个字段,则省略FROM,并包含WHERE即可.我不想为此进行5个单独的查询.但是我想我将不得不...

If I cut it down to 1 field, leave out the FROM, and include WHERE it works. I dont want to make 5 seperate queries for this. But I guess I am going to have to....

推荐答案

您的语法已关闭,应为UPDATE ... SET ... FROM:

Your syntax is off, and it should be UPDATE ... SET ... FROM:

UPDATE t1
INNER JOIN Table2 t2
    ON t1.[Asset ID] = t2.[Asset ID]
SET
    t1.Department    = t2.[Department],
    t1.[Cal Status]  = t2.[Cal Status],
    t1.[Return Date] = t2.[Return Date],
    t1.Comments      = t2.[Comments],
    t1.[Cal Due]     = t2.[Cal Due],
    t1.Active        = t2.[Active]

这篇关于MS Access更新查询不断询问“参数值".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆