|
-
Dec 20th, 2005, 12:18 PM
#1
Thread Starter
Addicted Member
Very general question - communication between forms
Is it possible for one form to call a function that resides on another form or do I need to create module with a Public function? I know this is fundamental, but I can't seem to find anything related to this.
Thanks.
-
Dec 20th, 2005, 12:23 PM
#2
Re: Very general question - communication between forms
if you make the function public in the form you can call from, say form1,
form2.myfunction
-
Dec 20th, 2005, 12:23 PM
#3
Fanatic Member
Re: Very general question - communication between forms
its possible...
say form1 wants to call a command button procedure on form 2
so it would be like this...
VB Code:
'command button on form 1
Public Sub Command1_Click
Form2.Command2_Click 'Command button on form 2 that you want to call.
End Sub
-
Dec 20th, 2005, 12:24 PM
#4
Re: Very general question - communication between forms
If you make the sub Public on your form, then it can be called from another form by explicitly referring to the form the sub is on.
VB Code:
'example
'On form1
Public Sub DoSomething()
'cool code
End Sub
'on Form2
Private Sub cmdDoSomething_Click()
Form1.DoSomething
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|