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 LICENSE NUMBERS, ACTIVATION 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.
This topic is 11 years and 9 months 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
mysapien@upgreat.ch
Posts: 5
Last visit: Fri Jan 26, 2024 3:09 am

multiform passing data to called form

Post by mysapien@upgreat.ch »

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
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

multiform passing data to called form

Post by davidc »

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
Last visit: Fri Jan 26, 2024 3:09 am

multiform passing data to called form

Post by mysapien@upgreat.ch »

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
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

multiform passing data to called form

Post by davidc »

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.
This topic is 11 years and 9 months 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.