How to Disable any Control based on condition

mkpjsrmkpjsr Member Posts: 587
Hi all,

I want to disable/enable a button control on a form based on some condition.
can anybody guide me, how to do this.

Comments

  • krikikriki Member, Moderator Posts: 9,110
    1) you need to give a name to the button (see name property of the button)
    2) To enable/disable it : currForm.TheButton.ENABLED(Some condition);

    BTW : IF you want to use it on a textbox, you better use EDITABLE(some condition)
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • chengalasettyvsraochengalasettyvsrao Member Posts: 711
    write the code on after record in form level.

    take this scenerio for example if the structure is there in the purchase order then Visible otherwise not.

    IF "structure " <> ' ' THEN

    CurrForm.Structure.VISIBLE(FALSE)

    ELSE

    CurrForm.Structure.VISIBLE(TRUE)
  • krikikriki Member, Moderator Posts: 9,110
    It is more readable/compact to write:
    CurrForm.Structure.VISIBLE("structure" = ' ')
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • matttraxmatttrax Member Posts: 2,309
    It's also more user friendly to leave the button enabled and throw an error if everything is not correct. A disabled button just leaves the user wondering how to enable it with no clues.
Sign In or Register to comment.