Previous Record on Escape

  • Thread starter Thread starter Guest
  • Start date Start date
G

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"
 
Klingon Coder said:
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.


--
 
Back
Top