How to execute many buttons using a single button?

Onlylonely

Registered User.
Local time
Today, 21:04
Joined
Jan 18, 2017
Messages
43
Hi Guys,

May i know how to execute many buttons using a single buttons?

I have a tag all the buttons with "Step1"

My code like below but not works.

Code:
Private Sub CheckPass_Click()

Click.ctrl.Tag = "Step 1" And Click.ctrl.Value = 1


End Sub
 
English may not be your first language, but what does that mean? No idea.
 
English may not be your first language, but what does that mean? No idea.


Hi MajP,

Single button click, then it will click all the buttons.

Code:
Private Sub CheckPass_Click()

    Dim ctrl As Control

    For Each ctrl In Me.Controls
    If CheckPass = True Then
    If ctrl.Tag = "Step1" Then ctrl.Value = 1
        'If ctrl.Name <> "CheckPass" Then If ctrl.Tag = "Step1" Then ctrl.Value = 1
        'If ctrl.Tag = "Step1" Then If ctrl.Name <> "CheckPass" Then ctrl.Value = 1
    
    

    ElseIf ctrl.Tag = "Step1" And ctrl.Value <> 1 Then

    CheckPass = False

'   End If
    End If
    
    Next
    
End Sub
 
Hi MajP,

Single button click, then it will click all the buttons.

Code:
Private Sub CheckPass_Click()

    Dim ctrl As Control

    For Each ctrl In Me.Controls
    If CheckPass = True Then
    If ctrl.Tag = "Step1" Then ctrl.Value = 1
        'If ctrl.Name <> "CheckPass" Then If ctrl.Tag = "Step1" Then ctrl.Value = 1
        'If ctrl.Tag = "Step1" Then If ctrl.Name <> "CheckPass" Then ctrl.Value = 1
    
    

    ElseIf ctrl.Tag = "Step1" And ctrl.Value <> 1 Then

    CheckPass = False

'   End If
    End If
    
    Next
    
End Sub

To run the click events of other buttons simply type this in code.

OhterButton_Click()
OtherButton2_Click()
OtherButton3_Clcik()
and so on.

Obviously substitute for correct button names.
 

Users who are viewing this thread

Back
Top Bottom