Hi All

So I have 2 forms

form 1 has a list of checkboxes on it

form 2 needs to check if one of the form 1 checkboxes is checked.

Please see the code below:

texton is a value passed from a function parameter of type string

If (Form1.Controls.Item("checkbox" & texton).checkstate" = True) Then
'Do Something        
End If

When I get to "If (Form1.Controls.Item("checkbox" & texton).<-- this point, intellisense does not list .checkstate or .checked as a member of checkbox from form1.

Any ideas

Thanks
John

Recommended Answers

If CType(Form1.Controls.Item("CheckBox" & texton), CheckBox).Checked = True Then
            MsgBox("done")
        End If
Jump to Post

All 2 Replies

If CType(Form1.Controls.Item("CheckBox" & texton), CheckBox).Checked = True Then
            MsgBox("done")
        End If

Excellent!
Works great

Once again,
Many thanks codeorder

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.