Ah..well of course. LOL Forgot that bit. It's my first code bank post.
Make a form with a textbox and a label. Paste this code into the code window.
vb Code:
Dim stack As New cp_Stack_cls
Private Sub Form_Load()
stack.Push "Form_Load"
PopStack
End Sub
Private Sub Label1_Change()
stack.Push "Label1_Change"
On Error GoTo errhandler
If InStr(1, Text1.Text, "a") > 0 Then
Err.Raise 83
End If
PopStack
Exit Sub
errhandler:
MsgBox "Error " & Err.Number & vbCrLf & stack.Trace
End Sub
Private Sub Text1_Change()
stack.Push "Text1_Change"
Label1.Caption = Text1.Text
PopStack
End Sub
Private Sub PopStack()
Debug.Print "Popped: " & stack.Pop
End Sub