In VB, does the concept of Form parameters exist? In that case: how do you declare them? If not: how is the best way to pass values between Forms?
Thanks in advance
Printable View
In VB, does the concept of Form parameters exist? In that case: how do you declare them? If not: how is the best way to pass values between Forms?
Thanks in advance
Please, I need some help about this. How can I pass some values from a Form to another? Only with global variables?
Not sure what ya mean by form parameters. But passing values between forms, persumably in the same project????
Ok three types of declares of variables right.
1. Private, only for current form
2. Public, can be passed to other forms
3. Global, declare in startup module and can be used by any form in the project.
Generally we declare standard variables in a startup module as Global...like Company Name, Fin Period etc..which will be used throughout the project. Also we declared a number of work variables which we use to pass values. This has the advantage of being tied into class and module resources, therefore saving on rewriting basic stuff for new projects.
Hope it helps. :)
Global variables is one way.
If you want to pass a variable to only one form, you can also write your own property get/let in the form, or create a function to pass the value.