Options

Getting Values from an open form

johndimjohndim Member Posts: 17
Hello everybody
I have a customer form opened and i want to know if can get from
another form when i push a button the value from one field in the customer form . For instance the No.

Thanks in advance

Comments

  • Options
    ArhontisArhontis Member Posts: 667
    Hi,

    If the customer form is a variable of the other form then you could use the GETRECORD function of the customer form variable to get the current record the customer form variable displays.

    That way you have every field in the record.
  • Options
    johndimjohndim Member Posts: 17
    Thanks for the answer but the situation is a liitle diferent
    I mean that the steps are exactly as follows :
    1 - I open the Customer form and then
    2 - from the button Customer i choose to open another form
    3 - Now in that other form i want to get the value of a field in customer form
    4 - i have to inform you that i don't want to link the two forms

    Best Regards John
  • Options
    ArhontisArhontis Member Posts: 667
    Hi John,

    No easy way you can do this. Every form is independent. Can't see other forms, I wish it could be done, but it's no delphi or VC... :(

    The only way I can think of is to make a global var "CustomerNo" in the "other form" and make a function with a parameter that sets that value.

    If you open the form via FORMS::... then you can't do anything, but using a form var, init the var, run the function you created with the customer no., SHOW the form variable, then you have the Customer No, in the global var of the "other form". Remember to call the new function inside the aftergetrecord of the customer form, in order to have them synchronized.

    I can't think of anything else...
  • Options
    Dean_AxonDean_Axon Member Posts: 193
    Tricky one because i'm guessing that your going to do something like this...

    Open Customer form on Customer "10000"

    Click "RunForm" button and then search through the records until you find the one you want. Once you have found this, THEN I assume that you will want to use a field from this record and pass it back to the record for Customer "10000" ???
    Remember: Keep it simple
  • Options
    johndimjohndim Member Posts: 17
    not exactly
    i want to be able to get the value of a control in the opened customer form
    and read it from another open form . (I don't mean a form variable opened from customer but an other form opened normally)

    Thanks both of you for the replies

    John
  • Options
    johndimjohndim Member Posts: 17
    I finally did it with a record variable
    in the second form i declared a record variable and i also made a function which populates this record variable with the parameter it gets. In the first form when i press the button i just call the function of the second form via a Form variable and passing the REC as a parameter

    :D
Sign In or Register to comment.