954,559 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Check Box Control Array Problem

Private Sub Check1_Click()
If Check2.Value = 1 Then Check2.Value = 0
If Check3.Value = 1 Then Check3.Value = 0
If Check4.Value = 1 Then Check4.Value = 0
If Check5.Value = 1 Then Check5.Value = 0
If Check1.Value = 1 Then Text1.Text = Check1.Caption
If Check1.Value = 0 Then Text1.Text = ""
End Sub


I want to do the same with control Array :

My Code :

If Check1(Index) Then
Text1.Text = Check1(Index).Caption
Else
For k = 0 To Check1.Count
Text1.Text = ""
Check1(i).Value = 0
Next
End If

But I can not get the same result with this code. Plz help.

Ravi Kant
Newbie Poster
13 posts since Jan 2009
Reputation Points: 11
Solved Threads: 1
 

You can save yourself a lot of time and code by using an array of option buttons instead of check boxes...

Private Sub Option1_Click(Index As Integer)
Text1.Text = Option1(Index).Caption
End Sub

and that is all the code you need...

Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You