Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Lost data changes upon Cancel

Discussion in 'Information Technology' started by ctdak, Oct 27, 2005.

  1. ctdak

    ctdak
    Expand Collapse
    Guest

    When allowing the user to cancel/exit out of a data input form by hitting the
    Escape button on the keyboard, any changes to the current record are lost.
    Is there any way to prevent the changes from being lost/undone as the form is
    being closed in this manner?
     
  2. Loading...

    Similar Threads Forum Date
    Lost Treasures Of The Sikh Kingdom - BBC Documentary History of Sikhism May 28, 2016
    lost patrol Blogs Oct 16, 2015
    Self lost patrol Blogs Oct 11, 2014
    Heritage Lost Treasures of the Sikh Kingdom History of Sikhism Nov 21, 2014
    Malaysia Second Malaysian Plane Lost in only 4 months! Breaking News Jul 18, 2014

  3. Ofer

    Ofer
    Expand Collapse
    Guest

    Try this post

    http://www.microsoft.com/office/com...ding&mid=68733deb-1a0b-4810-bf60-f696df43c2ba
    --
    If I answered your question, please mark it as an answer. That way, it will
    stay saved for a longer time, so other can benifit from it.

    Good luck



    "ctdak" wrote:

    > When allowing the user to cancel/exit out of a data input form by hitting the
    > Escape button on the keyboard, any changes to the current record are lost.
    > Is there any way to prevent the changes from being lost/undone as the form is
    > being closed in this manner?
    >
     
  4. ctdak

    ctdak
    Expand Collapse
    Guest

    You misunderstood me. I don't want the Escape key to be disabled. I want to
    allow the user to close a form using the Escape key, but I don't want changes
    to be lost to the current record when they do this.
    ctdak


    "Ofer" wrote:

    > Try this post
    >
    > http://www.microsoft.com/office/com...ding&mid=68733deb-1a0b-4810-bf60-f696df43c2ba
    > --
    > If I answered your question, please mark it as an answer. That way, it will
    > stay saved for a longer time, so other can benifit from it.
    >
    > Good luck
    >
    >
    >
    > "ctdak" wrote:
    >
    > > When allowing the user to cancel/exit out of a data input form by hitting the
    > > Escape button on the keyboard, any changes to the current record are lost.
    > > Is there any way to prevent the changes from being lost/undone as the form is
    > > being closed in this manner?
    > >
     
  5. Ofer

    Ofer
    Expand Collapse
    Guest

    I did, but from the example you were given change this
    If KeyCode = vbKeyEscape Then
    KeyCode = 0
    End If

    To
    If KeyCode = vbKeyEscape Then
    DoCmd.Close
    End If
    --
    If I answered your question, please mark it as an answer. That way, it will
    stay saved for a longer time, so other can benifit from it.

    Good luck



    "ctdak" wrote:

    > You misunderstood me. I don't want the Escape key to be disabled. I want to
    > allow the user to close a form using the Escape key, but I don't want changes
    > to be lost to the current record when they do this.
    > ctdak
    >
    >
    > "Ofer" wrote:
    >
    > > Try this post
    > >
    > > http://www.microsoft.com/office/com...ding&mid=68733deb-1a0b-4810-bf60-f696df43c2ba
    > > --
    > > If I answered your question, please mark it as an answer. That way, it will
    > > stay saved for a longer time, so other can benifit from it.
    > >
    > > Good luck
    > >
    > >
    > >
    > > "ctdak" wrote:
    > >
    > > > When allowing the user to cancel/exit out of a data input form by hitting the
    > > > Escape button on the keyboard, any changes to the current record are lost.
    > > > Is there any way to prevent the changes from being lost/undone as the form is
    > > > being closed in this manner?
    > > >
     
  6. ctdak

    ctdak
    Expand Collapse
    Guest

    Wonderful. I had never done anything with capturing user key actions, but
    this makes sense and does what I need, with one exception. All changes to
    the current record upon Escaping are now saved in the table - this is great!
    However, if you're in a text box when hitting Escape and you made a change to
    the data in that text box, then the control (Me!TextBoxControl) maintains the
    old value even though the table has the new value. If the user hits Tab (to
    move out of that control) and then Escape, the control in question then has
    the new value and matches the table value.

    Any idea why this is happening? It makes a difference to me because I am
    assigning the value of Me!TextBoxControl to a global variable and it needs to
    have the user's new value real-time.

    ctdak


    "Ofer" wrote:

    > I did, but from the example you were given change this
    > If KeyCode = vbKeyEscape Then
    > KeyCode = 0
    > End If
    >
    > To
    > If KeyCode = vbKeyEscape Then
    > DoCmd.Close
    > End If
    > --
    > If I answered your question, please mark it as an answer. That way, it will
    > stay saved for a longer time, so other can benifit from it.
    >
    > Good luck
    >
    >
    >
    > "ctdak" wrote:
    >
    > > You misunderstood me. I don't want the Escape key to be disabled. I want to
    > > allow the user to close a form using the Escape key, but I don't want changes
    > > to be lost to the current record when they do this.
    > > ctdak
    > >
    > >
    > > "Ofer" wrote:
    > >
    > > > Try this post
    > > >
    > > > http://www.microsoft.com/office/com...ding&mid=68733deb-1a0b-4810-bf60-f696df43c2ba
    > > > --
    > > > If I answered your question, please mark it as an answer. That way, it will
    > > > stay saved for a longer time, so other can benifit from it.
    > > >
    > > > Good luck
    > > >
    > > >
    > > >
    > > > "ctdak" wrote:
    > > >
    > > > > When allowing the user to cancel/exit out of a data input form by hitting the
    > > > > Escape button on the keyboard, any changes to the current record are lost.
    > > > > Is there any way to prevent the changes from being lost/undone as the form is
    > > > > being closed in this manner?
    > > > >
     

Share This Page