Changing TextBox options in C/AL code

Helo! I am designing a report and trying to make a TextBox visible only when a check box in Request Form in checked. Now I think this can only be posible by changing TextBox options in code (something like TextBox001.Visible := FALSE). I still haven’t figured it out exactly how to do it so i need help… please help lp JohnP

Hi John First name the control then it is just a case of calling RequestOptionsForm.“Control name”.VISIBLE := True/False; Paul Baxter

Paul I thank you for the answer but i have the TextBox in the sections area of the report and a checkbox in the ReguestForm area. Can anyone help with this problem?? Thank you

quote:


Originally posted by lordslayer
Paul I thank you for the answer but i have the TextBox in the sections area of the report and a checkbox in the ReguestForm area. Can anyone help with this problem?? Thank you


I’m afraid you can’t do that. You must define a text variable and fill it with the formatted value of your field when the checkbox is on and blank it when the checkbox is out, then use the text variable as the SourceExpression of the TextBox in the section area. [xx(] Anna

Thank you Anna, that helped me solve my problem…

Hi Anna!

I have a question for you.

Does it work only with checkbox?

I have a textbox containing a data from a relating table. This value can be set in a form.

I would like to make this textbox invisible when nothing is set in the form. Is is possible? Now when I have this control blank (no data) it send me an error message, that this value is not exist, and I can not even see the report.

Thanks a lot.