VBA 更新查询 [英] VBA update query

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

问题描述

下面的查询导致更新了零行

Below query is resulting zero rows updated

但我确定有记录要更新

DoCmd.RunSQL (" Update tbltesting set IsDiff ='Yes' " & _
                "where empid= " & Me.txtEmpId.Value & _
                " and testid= " & Me.txtAutoNumber.Value & ";")

请帮忙!!

推荐答案

运行此检查以确保您的字段具有您认为具有的数据:

Run this as a check to make sure your fields have the data that you think they have:

DoCmd.RunSQL (" SELECT * FROM tbltesting " & _
                "WHERE empid= " & Me.txtEmpId.Value & _
                " and testid= " & Me.txtAutoNumber.Value & ";")

顺便说一句,您可以省略 .Value 部分.

Incidentally, you can leave off the .Value portion.

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

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