Table of contents
TOC
折叠目录
展开目录

TextBox.OnUndo 属性 (访问)TextBox.OnUndo Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

返回或设置一个字符串,指示哪个宏、 事件过程或用户定义函数运行, Undo事件发生时。读/写.Returns or sets a String indicating which macro, event procedure, or user-defined function runs when the Undo event occurs. Read/write..

语法Syntax

表达式OnUndoexpression. OnUndo

表达式_一个表示文本框对象的变量。_expression A variable that represents a TextBox object.

注解Remarks

该属性有助于以编程方式更改事件别触发时 Microsoft Access 所采取的行动。例如,在各次事件调用之间可能要根据触发事件的环境更改表达式的参数,或从一个事件过程切换到一个表达式或宏。This property is helpful for programmatically changing the action Microsoft Access takes when an event is triggered. For example, between event calls you may want to change an expression's parameters, or switch from an event procedure to an expression or macro, depending on the circumstances under which the event was triggered.

此属性的有效值为" macroname" macroname_所在的宏,"[事件过程]"这表明在与指定的对象,或"= _functionname()"的 Undo 事件相关的事件过程_名称functionname_是用户定义函数的名称。Valid values for this property are " macroname" where macroname is the name of macro, "[Event Procedure]" which indicates the event procedure associated with the Undo event for the specified object, or "= functionname()" where functionname is the name of a user-defined function.

示例Example

下面的示例指定在当前项目第一个窗体上发生Undo事件,应运行相关的事件过程。The following example specifies that when the Undo event occurs on the first form of the current project, the associated event procedure should run.

Forms(0).OnUndo = "[Event Procedure]"

下面的示例指定在当前项目第一个窗体上的任意文本框中发生Undo事件,应运行相关的事件过程。The following example specifies that when the Undo event occurs in any text box on the first form of the current project, the associated event procedure should run.

Dim ctlLoop As Control 

For Each ctlLoop In Forms(0).Controls 
 If ctlLoop.Type = acTextBox Then 
 ctlLoop.OnUndo = "[Event Procedure]" 
 End If 
Next ctlLoop 

另请参阅See also

概念Concepts

TextBox 对象TextBox Object

© 2018 Microsoft