Thanks Craig for reply.
Actualy error has been remvove but below is not working.
I am using POST_CHANGE trigger to execute it.
while below is working
I need to set prompt dynamically.
When do you need your code to execute? After data is displayed (eg: Post-Query) or in response to a user edit (eg: Post-Change)? If you need the prompt to change as a result of the record being queried and displayed, then I would agree with O.Developer and you should put your code in the Post-Query trigger. If you need the prompt to change in both scenarios, then I would write a program unit and call it from the Post-Query as well as the When-Validate-Item triggers. I rarely if ever use the Post-Change trigger since this trigger has been deprecated and is only included for backward compatibility.
What is your Forms version?