| 416-621-9348 cgreaves@chrisgreaves.com | |
|---|---|
| Home Services Products |
A Means Of Implementing “Undo” On GUI Forms ; Legalities ; The GUI Form ; The Data Control Events ; The Preservation Structure ; Initializing The Form ; Recording A Change ; Undoing A Change ; Inhibiting Undo ; Running The Form
Inhibiting Undo
When we have no preserved values, we inhibit the Undo command button:
Function GUI_Undo() With typ(UBound(typ)) Me.cb1 = .blncb1 Me.cb2 = .blncb2 Me.ob1 = .blnob1 Me.ob2 = .blnob2 Me.ob3 = .blnob3 Me.tb1 = .strtb1 Me.tb2 = .strtb2 End With If UBound(typ) > 0 Then ReDim Preserve typ(UBound(typ) - 1) Else Me.cmdUndo.Enabled = False ‘ inhibit the Undo command button End If End Function
Likewise, as soon as we have a value that can be undone, we exhibit the Undo command button:
Function GUI_Preserve() If blnInhibit Then Else ReDim Preserve typ(UBound(typ) + 1) Me.cmdUndo.Enabled = True ‘ exhibit the Undo command button With typ(UBound(typ)) .blncb1 = Me.cb1 .blncb2 = Me.cb2 .blnob1 = Me.ob1 .blnob2 = Me.ob2 .blnob3 = Me.ob3 .strtb1 = Me.tb1 .strtb2 = Me.tb2 End With End If End Function
Loading
Toronto and Mississauga, Sunday, December 05, 2010 3:12 PM
Copyright © 1996-2010 Chris Greaves. All Rights Reserved.