@return problem

I have the following code in queryopen for a form called WO,

usr := @Name([CN];@UserName);

res := @DbLookup(“”:“”;“”:“”;“Control\SalesCodes”;usr;1);

@If ( @IsError(res) ; @Return(@Prompt([OK];“Notice”;“You are not allowed to create Work Orders.”));“”);

After the user gets the message, he is still able to create the doc. Is there a way to have the user just get the message and stop there.

Thanks

Jacob

Subject: @return problem

Put the code in the action button from where the form is being composed.

usr := @Name([CN];@UserName);

res := @DbLookup(“”:“”;“”:“”;“Control\SalesCodes”;usr;1);

@If ( @IsError(res) ; @Prompt([OK];“Notice”;“You are not allowed to create Work Orders.”);@Command([Compose];“WO”));

cheers !!

Ashish