Subforms

SnoddansSnoddans Member Posts: 5
edited 2001-06-18 in Navision Financials
I have this slight dilemma. The thing is I have to run 16 forms at the same time, every form is the same, but none can overlap each other, i.e. they all have to be in order. I decided to run a form with 16 subforms, eastablishing the order I want. Now, how can I set each subforms visability to false or true depending on values in a table I have created. That is if the value in the table is 8, only eight of the subforms will be displayed.

Thanks,
snoddans

Comments

  • wbenefielwbenefiel Member Posts: 12
    You will have to change the default control name to a defined name such as sfm1, sfm2, etc.

    Then add code similar to the below example:
    CurrForm.sfm1.Visible := MyValue = 1;
    CurrForm.sfm2.Visible := MyValue = 2;

    If you want to display multiple subforms at the same time, you will have to setup a CASE statement.

    CASE MyValue OF
    1 :
    BEGIN
    CurrForm.sfm1.Visible := TRUE;
    CurrForm.sfm2.Visible := FALSE;
    ...
    END;
    ...
    END;

    Hope this helps!

    Bill Benefiel
    NCPS,NCSD
    Manager of Information Systems
    Overhead Door Company of Indianapolis
    billb@ohdindy.com
    Bill Benefiel
    NCPS,NCSD
    Manager of Information Systems
    Overhead Door Company of Indianapolis
    billb@ohdindy.com
  • JohnPJohnP Member Posts: 56
    An alternative would be to have a tabbed control with one subform on each tab. When the form starts, only the first one is editable. You can then make each subform editable as you go. It allows the user to go back and see what they put on earlier tabs if they need to.

    Cheers,
    John
Sign In or Register to comment.