CodeItBetter Programming Another VB Programming Blog

How to click a command button on other form

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'Controls - How to click a command button on other form

Option Explicit
 
'Add two forms to your project. Add a Command Button to your form Form1.
'Add a Command Button to Form2.
'By clicking Form1 Button will click Form2 Button.

'Add the following code to Form 1

Private Sub Command1_Click()
    Form2.Command1.Value = True
End Sub
 
'Add the following code to Form 2

Private Sub Command1_Click()
    MsgBox "The button has been clicked"
End Sub
Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.