[RESOLVED] A Big problem with CheckBox array
Hi All
I looking on this Forum and didn't find this what i want
I have the array of checkbox's. All it be placed on a one form. They make possible choosing any configurations to calculations for user.
However not all they are accidental but some this create an dependence.
So, I want to make it.
For e.g. If I made vbChecked let's say for chk(1) which I have named The Cars, then should be also
made vbChecked let's say for chk(5) named Porshe and let's say for chk(10) named Jeep.
But....If I will want to make vbUnchecked for chk(10) this example, then I should can to do it.
The statement of condition it will not here useful.
Because then can't - in reference to above mentioned example - to make chk(10) vbUnchecked without switch off this chk(1).
Simply I want I has it a dependent in one direction but in a second direction already no
I hope it will good understood
Someone know how to make it, thanks in advance for some help me
Re: A Big problem with CheckBox array
What is wrong with this?
Code:
Private Sub chk_Click(Index As Integer)
Select Case Index
Case 1
If chk(1).Value = vbChecked Then
chk(5).Value = vbChecked
chk(10).Value = vbChecked
End If
End Select
End Sub
Re: A Big problem with CheckBox array
Thanks Martin
Orginally posted by Martin Liss
Quote:
What is wrong with this?
No, nothing in this has wrong.
I thought about the statement of condition as about single procedure - obviously for this example. I will admit, that I didn't thought about CASE procedure. However using with your prompt at last I made it so. It fine work.
Code:
Dim lValue As Long
lValue = chk(Index).Value
Select Case Index
Case 1
chk(5).Value = lValue
chk(10).Value = lValue
End Select
End Sub
Because in your example it didn't vbUnchecked for those controls (in your code: chk(5)) and chk(10) when I make switch off with return on a vbUnchecked for chk(1) control's