Pass Parameter from form to form 
Author Message
 Pass Parameter from form to form

Hi

May I know how to pass parameter from form1 to form2.

Regards
Robin



Sun, 27 Nov 2005 11:42:20 GMT  
 Pass Parameter from form to form
Add a public property to form2, to be set by form1, or

Add a public property to form1, to be read by form2, or

Add a method to form2, that receives the parameter as an argument,

etc


Quote:
> Hi

> May I know how to pass parameter from form1 to form2.

> Regards
> Robin



Sun, 27 Nov 2005 11:49:05 GMT  
 Pass Parameter from form to form
Sorry, I still couldn't get it. I still got syntax error. Actually what I
want is for form1, it has 3 labels. When I click on any of the label, form2
will display which label I click from form1. Here is my code.

form1 :  (I've 3 label)

Private Sub Label1_Click()
    Form2.M2!tem = "label1"

End Sub

form2 :

Public sub M2()
    dim tem as string
    msgbox tem
end sub

Regards
Robin


Quote:
> Hi

> May I know how to pass parameter from form1 to form2.

> Regards
> Robin



Sun, 27 Nov 2005 13:21:38 GMT  
 Pass Parameter from form to form

Quote:

> Sorry, I still couldn't get it. I still got syntax error. Actually what I
> want is for form1, it has 3 labels. When I click on any of the label, form2
> will display which label I click from form1. Here is my code.

Have a look at the changes....
Quote:

> Private Sub Label1_Click()
>     Form2.M2 "label1"   '< passing a parameter

> End Sub

> form2 :

> Public sub M2(tem as string)  '<  Accepting a parameter
>     msgbox tem
> end sub



Sun, 27 Nov 2005 14:38:32 GMT  
 Pass Parameter from form to form

Quote:
> Sorry, I still couldn't get it. I still got syntax error. Actually
> what I want is for form1, it has 3 labels. When I click on any of the
> label, form2 will display which label I click from form1. Here is my
> code.

> form1 :  (I've 3 label)

> Private Sub Label1_Click()

     Form2.M2 "label1"

Quote:
> End Sub

> form2 :

 Public sub M2(ByVal TheInfo As String)
     msgbox TheInfo
 end sub

Quote:

> Regards
> Robin



>> Hi

>> May I know how to pass parameter from form1 to form2.

>> Regards
>> Robin

--
Reply to the group so all can participate
Personal replies to bob_butler Chr$(64) cox Chr$(46) net
VB.Net... just say "No"


Sun, 27 Nov 2005 21:03:56 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How can I pass parameter from a form to another 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. Passing multiple parameters to Access query using Form List Box

5. Pass a Parameter to a form?

6. Parameter passing between a form and a query

7. Passing Parameters to a form

8. Parameter passing and Opening/Closing Forms

9. Passing parameter to query from multiple forms

10. Passing an existing form as parameter

11. Passing parameters to a form

12. Passing Parameter from MSAccess to Word Form

 

 
Powered by phpBB® Forum Software