静默更新表 [英] Update table silently

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

问题描述

嗨我有一个下面显示的功能,它会增加一个数字并将它存储在Access中的表格中。


这样可以正常工作除了我希望它默默地更新数字

而不是询问用户你即将更新1行。单击是

后,您无法使用撤消命令来反转更改。这个数字

应该存储,用户甚至不知道它。这有可能吗?
可能吗?


函数IncrementLastUsedNumber()


将myNumber调整为整数

Dim strSQL As String


myNumber = DMax(" [LastUsedNumber]",tableLastUsedNumber)+ 1

strSQL =" ; UPDATE tableLastUsedNumber SET LastUsedNumber =" &

myNumber& "

DoCmd.RunSQL(strSQL)


结束功能


非常感谢!

Hi I''ve got a function shown below which increments a number and stores
it back in a table in Access.

This works fine except I would like it to update the number silently
and not ask the user "You are about to update 1 row. Once you click yes
you cant use the Undo command to reverse the changes". This number
should be stored without the user even know about it. Is this at all
possible?

Function IncrementLastUsedNumber()

Dim myNumber As Integer
Dim strSQL As String

myNumber = DMax("[LastUsedNumber]", "tableLastUsedNumber") + 1
strSQL = "UPDATE tableLastUsedNumber SET LastUsedNumber = " &
myNumber & " "
DoCmd.RunSQL (strSQL)

End Function

Many thanks!

推荐答案

找到我自己的答案来取消搜索。干杯


其docmd.setwarnings错误


在代码之前,docmd.setwarnings之后就是真的。


ROCK ON!

Found my own answer call off the search. Cheers

Its docmd.setwarnings false

Before the code then docmd.setwarnings true after it.

ROCK ON!


很高兴你找到它,我在想自己。

Glad you found it, I was wondering myself.

你在工作中做什么? (我也在工作lol)

What do you do at your work? (I''m at work too lol)


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

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