I have a program with tons of checkboxes (over 250). I also have 2 or 3 combo boxes next to the checkbox. How it works is when a user checks a checkbox, the combo boxes need to become visible. I wrote code for each and every checkbox, but it caused the program to run out of memory. To give you an idea, what I have written is...
[CODE=vb]Private Sub chk70_Click()
If chk70.Value = True Then
cbxYN47.Visible = True
cbxB47.Visible = True
lbl35.Visible = True
lbl36.Visible = True
Else
cbxYN47.Visible = False
cbxB47.Visible = False
End If
End Sub[/CODE]
My main question is can I have a routine that will be called when any checkbox is clicked, rather than having 250 subroutines?
[CODE=vb]Private Sub chk70_Click()
If chk70.Value = True Then
cbxYN47.Visible = True
cbxB47.Visible = True
lbl35.Visible = True
lbl36.Visible = True
Else
cbxYN47.Visible = False
cbxB47.Visible = False
End If
End Sub[/CODE]
My main question is can I have a routine that will be called when any checkbox is clicked, rather than having 250 subroutines?
Comment