How can I pass parameter from a form to another form 
Author Message
 How can I pass parameter from a form to another form

Hi,
 I have to pass some parameter from a form to another form. I try creating a
public method, in the same way I do with a Class, but I have a very large number
of parameter, so my function args-list become longer and longer. Is there any
way, using API or other to do this? Thanks Marco


Sat, 09 Aug 2003 16:19:04 GMT  
 How can I pass parameter from a form to another form

Quote:

> Hi,
>  I have to pass some parameter from a form to another form. I try creating a
> public method, in the same way I do with a Class, but I have a very large number
> of parameter, so my function args-list become longer and longer. Is there any
> way, using API or other to do this? Thanks Marco

You could define a user defined type (structure) in a global module.
Create an instance of it, fill it with your parameters, and pass it to
the other form by reference if possible. That way, you don't have to
change the parameters at all, just add to the UDT.
--
Roger Abbott
http://www.rhaminisys.com
DDE ActiveX Controls for VB. DDE FAQ
Other freeware and shareware


Sun, 10 Aug 2003 00:34:12 GMT  
 How can I pass parameter from a form to another form

Quote:
>You could define a user defined type (structure) in a global module.
>Create an instance of it, fill it with your parameters, and pass it to
>the other form by reference if possible. That way, you don't have to
>change the parameters at all, just add to the UDT.

I agree with this method, but i would say to take it one step further, create a property on the form that is receiving,
then pass the UDT to that property, then instantiate/call the form as per normal. When you receive control back from
that form, just query the property to get the updated values.

sluggy



Sat, 09 Aug 2003 22:05:47 GMT  
 How can I pass parameter from a form to another form
Do you mean you want to call another form's public function in a form or
only want to share some variables between forms? If you add the parameters
frequently, you can use a variant array as the parameter of the function
and add the values of original parameters into the array. Then you needn't
change the function definition any more. But there're some limitation, such
as not able to handle user-defined types.


Sun, 10 Aug 2003 10:34:59 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Pass Parameter from form to form

2. Forms Collection: Using it to Open Forms by Passing the Form Name as a String Variable

3. passing focus info form form to form

4. How do I create a canned form?

5. Passing multiple parameters to Access query using Form List Box

6. Pass a Parameter to a form?

7. Parameter passing between a form and a query

8. Passing Parameters to a form

9. Parameter passing and Opening/Closing Forms

10. Passing parameter to query from multiple forms

11. Passing an existing form as parameter

12. Passing parameters to a form

 

 
Powered by phpBB® Forum Software