Previous Record on Escape

K

Klingon Coder

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"
 
M

Michael J. Strickland

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.


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top