Get the Value from Another form

dilipkinthadadilipkinthada Member Posts: 11
Hi all,
I wanted to get a textbox value which is in another form, How can i get that.
Actually i have a order form and from there i call
another form called Accessories. Now in that
form Accessories i wanted the value of a textbox


Can anyone help me in doing this?

Comments

  • ufukufuk Member Posts: 514
    You can add a function to the called form which returns the value of the textbox.
    Ufuk Asci
    Pargesoft
  • dilipkinthadadilipkinthada Member Posts: 11
    Hi,

    I added a function in the called form which returns the value of textbox.
    when i debug it is showing the value .. but when i close the second form..i am getting empty value

    Reg
    Dilip
  • KYDutchieKYDutchie Member Posts: 345
    Hi,

    Yes, you get an empty value because the form is not open anymore.
    The value that you are retrieving from the other form, is it stored in a table?
    If so, why don't you just read the record instead and get the value that way.

    Regards,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • SPost29SPost29 Member Posts: 148
    Hi,
    The pattern I have used is this:


    Create a function on the called form like SetValues(1,2,3,etc);
    Create a function on the called form like GetValues(var1, var2,var3,etc)

    On the calling form create a variable for the form CalledForm

    On a button or menu choice

    Clear(calledform);
    Calledform.setvalues(1,2,3,etc); sends any values to be used on the called form
    calledform.run or runmodal
    you can set the values on the OnOpen trigger
    After you close the called form it is still in scope so you can call

    Calledform.getvalues(var1,var2,var3,etc); gets any values set in the called form

    I hope this helps

    Steve
  • dilipkinthadadilipkinthada Member Posts: 11
    Hi ,

    I tried ur code and it worked.
    Thank you.

    Reg
    Dilip.
Sign In or Register to comment.