how to prevent running OnExit procedure, if pressing Cancel Command?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mihail
    Contributor
    • Apr 2011
    • 759

    #31
    Maybe for you, NeoPa, post 13 is like the sun light.
    Now, after I see your post, I read more carefully post 13 and I understood my mistake. I am here to gain help and, if I can, to provide help, not to disturb.
    Sorry but I think that I can't avoid all the time that kind of mistakes. So, if you wish to deny my access... that is. Sorry again.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32634

      #32
      I think you misunderstand me Mihail. I was saying the opposite. We welcome and appreciate all attempts to help, regardless of how useful they prove to be.

      Even if, in this case, your post didn't prove very helpful, it is still welcomed, as are you.

      I'm sorry if I sound stupid repeating myself, but I wanted to be absolutely sure you understand me clearly now.

      Comment

      • Mihail
        Contributor
        • Apr 2011
        • 759

        #33
        Ok.
        No problem.
        Good luck to all !

        The pop-up window require at least 40 characters.
        Hope now there are enough :)

        Comment

        • Mihail
          Contributor
          • Apr 2011
          • 759

          #34
          Hi, again !
          If I don't misunderstood (again) the really task isn't to avoid EXIT event for the TextBox. The Really task is to restore the value for TextBox if the CANCEL button is pressed.
          If THIS IS the task I prepare an example for you:

          In a form I have:
          - a TextBox control named MyTextBox.
          - another TextBox control named txtWitness

          Both text boxes have the same CONTROL SOURCE.

          - a CommandButton named cmdCancel

          And this code:

          Code:
          Option Compare Database
          Option Explicit
          
          Dim OldTextBoxValue
          
          Private Sub MyTextBox_Enter()
              OldTextBoxValue = MyTextBox
          End Sub
          
          Private Sub cmdCancel_Click()
              MyTextBox = OldTextBoxValue
          End Sub
          I think do not need comments.

          Good luck !

          Comment

          Working...