我怎样才能从进入VBA更新查询提示的值?提示、VBA

2023-09-08 10:55:27 作者:我们床上聊

当我们运行我们得到提示说,这么多recordr将要更新的一个更新查询。你想继续'是有可能的提示信息中的值捕捉到即记录将被更新数的变量。

When we run a update query we get prompt saying that 'these many recordr are going to be updated. do you want to continue' is it possible to capture the value in the prompt message to a variable i.e the number of records going to be updated.

推荐答案

如果您从code中的查询,您可以使用记录受影响的属性:

If you run the query from code, you can use the records affected property:

Dim db As Database
Set db=CurrentDB
db.Execute "Some SQL here"
db.RecordsAffected

如果你使用事务,你可以回滚。

If you use a transaction, you can rollback.