可以用select case 来实现
i= text1.text
select case i
case 2
if check1(2).value=1 and check1(1).value=1 then
case 3
if check1(3).value=1 and check1(2).value=1 and check1(1).value=1 then
End Select
你好,if语句中是可以用And连接的。但是我没有明白你的意思,你是在用复选框做什么呢?其实你可以用一个frame把那些单选复选都放在一起。
Select Case Val(Text1)
Case 1
'你的代码
Case 2
'你的代码
Case 10
'你的代码
End Select
Private Sub Command1_Click()
Dim f As Boolean
If Text1 = 2 Then
For i = 1 To 2
f = Me("check" & i).Value = 1
If Not f Then Exit For
Next
ElseIf Text1 = 3 Then
For i = 1 To 3
f = Me("check" & i).Value = 1
If Not f Then Exit For
Next
End If
If f Then MsgBox f
End Sub
VB6专家百度Hi群1358368