Table of contents
TOC
Collapse the table of content
Expand the table of content

ComboBox.Undo Event (Access)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Occurs when the user undoes a change.

Syntax

expression. Undo( ** Cancel**, )

expression A variable that represents a ComboBox object.

Parameters

NameRequired/OptionalData TypeDescription
CancelRequiredIntegerSet this argument to True to cancel the undo operation and leave the control or form in its edited state.

Remarks

The Undo event for controls occurs whenever the user returns a control to its original state by clicking the Undo Field/Record button on the command bar, clicking the Undo button, pressing the ESC key, or calling the Undo method of the specified control. The control needs to have focus in all three cases. The event does not occur if the user clicks the Undo Typing button on the command bar.

Example

The following example demonstrates the syntax for a subroutine that traps the Undo event for a form.

Private Sub Form_Undo(Cancel As Integer) 
 Dim intResponse As Integer 
 Dim strPrompt As String 

 strPrompt = "Cancel the undo operation?" 

 intResponse = MsgBox(strPrompt, vbYesNo) 

 If intResponse = vbYes Then 
 Cancel = True 
 Else 
 Cancel = False 
 End If 
End Sub

See also

Concepts

ComboBox Object

© 2018 Microsoft