Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

when validate item and key next item

Status
Not open for further replies.

shailu77

Programmer
May 5, 2003
7
0
0
IR
Hii,

Thanks guys for ur help. I have one more question...]
On a form with text items and the mouse navigation is disabled.... i want to validate an item using some piece of code. can i use the code in both when validate item and also keynext item and will it work with both when i want to navigate to next item or only with WHEN VALIDATE ITEM and if so y???

Thanks
Shailu
 
Your validation code only needs to be in the WHEN-VALIDATE-ITEM trigger. No matter how the cursor exits the text item, the WHEN-VALIDATE-ITEM trigger will fire.

Consider this, a user modifies a text field and then (without exiting the item) tries to commit/save. KEY-NEXT_ITEM will not fire, however WHEN-VALIDATE-ITEM will fire. If your validation code is only in KEY-NEXT_ITEM, then invalid data could be saved into your database.

[sup]Beware of false knowledge; it is more dangerous than ignorance. ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
[sup]When posting code, please use TGML to help readability. Thanks![sup]
 
Hi there

BJCooperIT has a valid point but also dont forget that KEY-NEXT-ITEM replaces the event that caused it.

So if you pressed enter on the item, and you have a KEY-NEXT-ITEM trigger on the item, the KEY-NEXT-ITEM will fire but you will have to code in an enter!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top