problem with focus in a form (with card and tubular)

gonzy1981gonzy1981 Member Posts: 156
I have in the same form, form card and tabular form (subform). If i've the focus in the form card and i click in one menu item, i want load some information in the form card, but if i've the focus in the tabular form i want to load the information in the subform.

Do you know how to know in what form or subform i have the focus for to load the information?
Thanks

Comments

  • garakgarak Member Posts: 3,263
    Hope i underst. it correct.

    give the Subform a name and in the Subform create a function.
    In this function u set the focus an you needed control.

    Like this:
    FunctionInSubform() <- The Function in your subform
    CurrForm.YourControl.activate();
    
    //from Mainform
    currform.NameOfTheSubform.FunctionInSubform();
    

    As example how to create a function on Subform and how to use it, take a look behind form 42 -> Button Line -> Dimensions

    Regards
    Do you make it right, it works too!
  • MBergerMBerger Member Posts: 413
    the problem is that as soon as you click your button in your main form that the main form will have the focus, even if you had the subform selected, because the button is IN the form.

    There IS a way around it though : work with a keyboard shortcut...
    Make a menubutton in BOTH forms, and make an entry in both with the same keyboard shortcut, and put the different code on each of these entries. then hide the menubutton somewhere out of sight ( behind another control ).

    If you are in your mainform, the menubutton there will be executed when pressing the shortcut, when in the subform the on on the subform.
Sign In or Register to comment.