Home » Developer & Programmer » Forms » To perform check on text item
To perform check on text item [message #300758] Mon, 18 February 2008 00:56 Go to next message
AnamikaChaudhary
Messages: 33
Registered: December 2007
Location: Mumbai
Member
Hi Everyone...

I have two text items on my data block.When i leave 1st text and entering second one , then i have to check certain condition on second.. & i have global code that if the 2nd field is null then some value is assigned.

I used PRE-TEXT-ITEM .........but getting an error of restricted procedure for go_item(field name).Even i used KEY-NEXT-ITEM on first field but not working....so which trigger i'll use to validate(or to check) the 2nd field



Re: To perform check on text item [message #300778 is a reply to message #300758] Mon, 18 February 2008 01:55 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
What do you want to do exactly?
Do you want to go to some other item when the condition met?
Try to write your code in when-new-item-instance of second item.

By
Vamsi
Re: To perform check on text item [message #300815 is a reply to message #300758] Mon, 18 February 2008 03:14 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is a scenario:
- a form is opened, all items are empty
- you enter something into the first item
- then you navigate out of it and want to check something on the second.

How and why? The second item is empty, isn't it? Does it have an initial value? Do you populate it with something in the WHEN-NEW-FORM-INSTANCE trigger, for example? If not, how can you validate an empty item? It is ... well, empty. Shouldn't you validate the second item after navigating out of it? If so, do that in the WHEN-VALIDATE-ITEM trigger.
Re: To perform check on text item [message #300831 is a reply to message #300815] Mon, 18 February 2008 03:42 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Littlefoot,
If I'm not wrong, OP says there is some code, which initializes the second item.
Quote:
i have global code that if the 2nd field is null then some value is assigned.
By
Vamsi

[Updated on: Mon, 18 February 2008 03:42]

Report message to a moderator

Re: To perform check on text item [message #300842 is a reply to message #300831] Mon, 18 February 2008 04:19 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Right; I translated it as "I have a global variable and may use it if the second item is left empty". It seems that I was wrong.
Re: To perform check on text item [message #300956 is a reply to message #300758] Mon, 18 February 2008 18:01 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Why do you need to do a 'go_item' when you are already 'moving' to the field?

Please post your code and use 'code' tags.

David
Previous Topic: Creating Set up.exe and attching help files & tag files with the forms made in D2K
Next Topic: Cursor manipulation within a text item
Goto Forum:
  


Current Time: Fri Sep 27 10:32:09 CDT 2024