Welcome to SPN

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

Sign Up Now!

Previous Record on Escape

Discussion in 'Information Technology' started by Klingon Coder, Jul 28, 2006.

  1. Klingon Coder

    Klingon Coder
    Expand Collapse
    Guest

    Hi, I'm hoping someone will be able to assist me with a problem. I have a
    form where a user enters information on requisitions. The textbox for the
    requisition number is bound to the field ReqNum which is the primary key for
    the underlying table.

    I had an occasion where a user started to enter information into the text
    box, hit the escape key and then tried to navigate to a different record,
    which triggered an error message warning them that they could not save a
    record with a null value in the primary key field.

    I would like to set up the form to reset to the previous record should this
    situation arise in the future. Any suggestions?

    --
    Cheers

    Klingon Coder

    "Ancient Klingon Proverb - Act and you shall have dinner, Think and you
    shall be dinner"
     
  2. Loading...


  3. Michael J. Strickland

    Michael J. Strickland
    Expand Collapse
    Guest

    "Klingon Coder" <KlingonCoder@discussions.microsoft.com> wrote in message
    news:0B51DD36-D8E8-455C-A26A-8BB807C9868B@microsoft.com...
    > Hi, I'm hoping someone will be able to assist me with a problem. I have a
    > form where a user enters information on requisitions. The textbox for the
    > requisition number is bound to the field ReqNum which is the primary key
    > for
    > the underlying table.
    >
    > I had an occasion where a user started to enter information into the text
    > box, hit the escape key and then tried to navigate to a different record,
    > which triggered an error message warning them that they could not save a
    > record with a null value in the primary key field.
    >
    > I would like to set up the form to reset to the previous record should
    > this
    > situation arise in the future. Any suggestions?
    >
    > --
    > Cheers
    >
    > Klingon Coder
    >
    > "Ancient Klingon Proverb - Act and you shall have dinner, Think and you
    > shall be dinner"



    Sounds like you need to validate user input with the text box's validate
    event. Then if the user hits ESC or otherwise inputs invalid data, you can
    just return him to the original value of the current record and they
    can navigate to other records normally from there.


    --
    ---------------------------------------------------------------
    Michael J. Strickland
    Quality Services qualityser@att.net
    703-560-7380
    ---------------------------------------------------------------
     

Share This Page