command button properties

hi everybody i’m developing a form which has some command buttons (setup, reports…). we want this form to show some buttons depending on values from a configuration table, i.e. i have a boolean field in config. table which determines if a button will be enabled or not. in the OpenForm trigger of my developed form i put this code OpenForm() (…) tblSetup.get; // read config table CurrForm.btnX.ENABLED := tblSetup.“Show button X”; when i run the form the system shows the error The form does not recognize the control 10000000005 the number 10000000005 is the command button id. does anyone knows what’s happen? regards!

give the name to those buttons and if tblSetup.“Show button X”=true then currform.btn1.enabled(true) else currform.btn1.enabled(false);

ok i deleted the form and copied the standard 332 General Ledger Menu into form 50520 and inserting the same code as before it seems to work. but i still don’t know what could happen… regards

ok, i have localized the problem. the code: OnInitForm (…) recSetup.get; CurrForm.MAXIMIZEDONOPEN(TRUE); OnOpenForm CurrForm.btnX.ENABLED(recSetup.“Show button X”); when i put some code like this, the form can’t resolve the button id i think… i’m trying to make this form the Main form for some specific users, so when the user opens the company this form has to be shown maximized and some buttons enabled depending on config. i don’t know why but i can’t modify dinamically MAXIMIZEDONOPEN (form) and ENABLED (buttons). anyone knows why??? zanx

Have u tried Visible property for button