Passing data in a Multiform Project

Archived support forum for customers who once purchased a PrimalForms product license. This forum is locked.
This topic is 12 years and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
burtcbl
Posts: 24
Last visit: Mon Oct 07, 2013 12:47 pm

Passing data in a Multiform Project

Post by burtcbl »

I am having a very hard time figuring out how to pass data between the multiple forms in a multiform project. I want to be able to bring up a separate child form, select some data in that child form and when that form closes, the selected data will be used to update the contents of a textbox on the main form.

I find little to nothing in the way of help in your documentation. Is there anyone out there that has done this?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Passing data in a Multiform Project

Post by davidc »

You can call one form from another in a Project by using the
reference function name. For example, to call Form2.pff,
use the reference function: Call-Form2_pff.When you use the reference function it will automatically
generate variables for certain types of controls. For example, if the Form2 has
a ComboBox and TextBox control it will return the following variables
containing the selected values:$Form2_comboBox1$Form2_textBox1The variables each return variable name consists of the form
David
SAPIEN Technologies, Inc.
User avatar
burtcbl
Posts: 24
Last visit: Mon Oct 07, 2013 12:47 pm

Passing data in a Multiform Project

Post by burtcbl »

I'm having some problems making this work. I'm confused as to where you're getting the return "OK" from the called form. I assume that is a button but I'm not sure.
User avatar
burtcbl
Posts: 24
Last visit: Mon Oct 07, 2013 12:47 pm

Passing data in a Multiform Project

Post by burtcbl »

OK, I got it to work by putting the
write-host statement after the If statement. I'm still not sure how you get the called form to return a value of "OK" . Need clarification on that.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Passing data in a Multiform Project

Post by davidc »



You the
"OK" refers to the way the form was closed. For example, if the user
clicked the "OK" button as oppose to the
David
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Passing data in a Multiform Project

Post by davidc »

FYI, you can always ignore the return value if you like. Use if only if you care if the user cancels an action or not. David
David
SAPIEN Technologies, Inc.
User avatar
burtcbl
Posts: 24
Last visit: Mon Oct 07, 2013 12:47 pm

Passing data in a Multiform Project

Post by burtcbl »

Thanks David. I got it.
User avatar
mssapien
Posts: 23
Last visit: Fri Oct 23, 2015 1:27 am

Passing data in a Multiform Project

Post by mssapien »

How do I fetch controls from Form1 to Form2?Code in Form1:Call-Form2_pffCode in Form2:Write-Host $Form1_TextBox1.TextDoes not work..
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Passing data in a Multiform Project

Post by davidc »

The return values are not the control, but the string. In this case you just use: Write-Host $Form1_TextBox1 David
David
SAPIEN Technologies, Inc.
This topic is 12 years and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.