multiform passing data to called form

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
mysapien@upgreat.ch
Posts: 5
Joined: Tue Jun 19, 2012 4:10 am

multiform passing data to called form

Post by mysapien@upgreat.ch » Tue Jun 19, 2012 4:10 am

I've created a multiform project in which records can be added to a listbox by calling a second form to enter the required data.I managed to get the data back from the called form.Now I would need to add editing capabilities to this by populating the controls (simple textboxes) of the called form with values from the listbox, so that the user can edit them.But the variables that i use to get the data back, seem not to have any effect in the reverse.Here's an excerpt of the test-call:$AccountForm_textboxAccountUsername="Some Text"if((Call-AccountForm_pff) -eq "OK"){ Write-Host $AccountForm_textboxAccountUsername}


druf@up-great.ch2012-06-19 11:11:54

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

multiform passing data to called form

Post by davidc » Tue Jun 19, 2012 4:41 am

Those variables only return the result when a sub form is called and can't be used to initialize. If you need to pass parameters add a parameter block to the top of the subform's editor: param ([string]$textvalue) Then initialize the textbox in the Form's load event block. Next you update the subform call as follows: if((Call-AccountForm_pff -textvalue "Some text") -eq "OK"){...}
David
SAPIEN Technologies, Inc.

User avatar
mysapien@upgreat.ch
Posts: 5
Joined: Tue Jun 19, 2012 4:10 am

multiform passing data to called form

Post by mysapien@upgreat.ch » Tue Jun 19, 2012 5:32 am

Many thanks.That was exactly what I was looking for.Are there any good sample projects, which show all this concepts of a multiform-project

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

multiform passing data to called form

Post by davidc » Tue Jun 19, 2012 6:12 am

It's on my TODO list :) There are some projects on the blog but they don't use parameter passing between forms. David
David
SAPIEN Technologies, Inc.