VBA使用SQL [英] VBA using SQL

查看:73
本文介绍了VBA使用SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在尝试使用SQL语法在Access VBA中编写代码。它应该按照以下方式工作:当用户更改表单中的特定字段时,应将其用户名添加到表和行中,其中存在更改。我使用事件更新后。代码在这里:

Hello all,

I am trying to write a code in Access VBA usin SQL syntax. It should work thuis way : when a user changes a specific field in a form, his user name should be added into the table and row, where there was the change. I use event "after update". The codes is here:

展开 | 选择 | Wrap | 行号

推荐答案

我看不到你在哪里调用SQL ()Sub-Routine并传递String Argument和可能的参数。
I don''t see where you are Calling the SQL() Sub-Routine and passing it the String Argument and possibly the Optional Parameter.


我不知道我是否正确理解你的回复。 SQL在SQL之后运行。我以其他形式使用它并且它有效。即使我不使用Sub SQL但直接使用DoCmd.RunSQL(...;),我也会得到同样的错误。我得到运行时错误3075 - 语法错误(缺少运算符)。
I don''t know if I understand your reply correctly. The SQL is run after the "SQL". I use this in other forms and it works. Here I get the same error even if i don''t use the Sub SQL but straight DoCmd.RunSQL (" ... ;"). I get runtime error 3075 - syntax error (missing operator).


看起来你有两个实例,其中SQL空间中存在双空格("),尝试删除它们,手动或以编程方式(通过第8行):
It appears that you have 2 instances where Double Spaces (" ") exist within the SQL String, try removiing them, either manually, or programmatically (via Line# 8):
展开 | 选择 | Wrap | 行号


这篇关于VBA使用SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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