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 |