Updating controls in a master/detail form

xavigepexavigepe Member Posts: 185
Hi. I have a master/detail form. In the "header" I have a text control where I need to display the information of the description field in the
selected line of the detail subform (don't ask me why :oops: ). I have a function in the subform wich returns the line number and so I can get the description and save it in a global variable or even in a table, but after all I'm not able to display it in my text control in the header.

Could you help me please?.

Thkx,

Comments

  • Soft_TodSoft_Tod Member Posts: 43
    It is impossible to make anything foolproof, because fools are so ingenious.
  • xavigepexavigepe Member Posts: 185
    Yes I can pass information from my subform to my main form, the problem is displaying that information in a textbox in my form.
  • andreofandreof Member Posts: 133
    try this:

    CurrForm.Update(False)
    Andre Fidalgo
    My world: Dynamics NAV,SQL and .NET

    CEO at Solving Dynamics
    http://www.solvingdynamics.com
  • xavigepexavigepe Member Posts: 185
    No luck. ](*,)

    I have an error message "The form is not open"
  • andreofandreof Member Posts: 133
    when are you calling the function in the subform?

    and where are you using CurrForm.Update(false)?
    Andre Fidalgo
    My world: Dynamics NAV,SQL and .NET

    CEO at Solving Dynamics
    http://www.solvingdynamics.com
  • xavigepexavigepe Member Posts: 185
    Thanks for your help. I'm calling the function in the subform FORM - ONAFTERGETCURRRECORD and I'm using your statement in the main form in the function called by the subform. I' m afraid as other people said in fact I can't pass data from a subform to a main form, I will try putting the information in a "false" header in the subform.
  • andreofandreof Member Posts: 133
    Now i think i understand.

    You cannot call a function in the main form from the subform.
    You're calling a function from a form, but its another instance not the main form. That's wy you're having that message ("The form is not open"). You have to find another way to do what you want, or with timers or single instance CU.

    Hope i understood correctly and this helps,

    regards
    Andre Fidalgo
    My world: Dynamics NAV,SQL and .NET

    CEO at Solving Dynamics
    http://www.solvingdynamics.com
  • BalelloBalello Member Posts: 61
    With some performance loss you can set 2 variable one global on Form and the other on the subform and a function that retrieve the value. Then you call the function on OnTimer and change the form variable value only if it's different, otherwise it refresh to much times per second, (remember: call form.update(false) after updating the variable). Subsequently:

    OnTimer (set 200ms for example)

    if Variable <> subformName.getVariable() then begin
    variable := subformName.getVariable();
    currform.update(false);
    end;
    You can also use OnActivate trigger..... but I seldom use it.
    I don't envy anybody who caught up his aim. I travel gladly.
Sign In or Register to comment.