Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

TypeOf Controls

$
0
0
Hi
I want to use this code for several forms but when
I call the function I get an error that the variable
not defined and Controls is highlighted.
If I declare Controls as a variant var I get and
error 424 object required.
Is this possible?

Code:

VB6
Function btnCheckOn(frmall As Form)
Dim BtnCmd As Control

  For Each BtnCmd In Controls
    If TypeOf BtnCmd Is CommandButton Then
        BtnCmd.Enabled = True
    End If
  Next
 
End Function


Viewing all articles
Browse latest Browse all 21090

Trending Articles