求助 循环问题
txtjg“000 001 010 011 100 101 110 111”chklm(0)caption(00) chklm(1)caption(01) chklm(2)caption(02)
当我选中chklm(0)caption(00)时 下面这段代码没问题,如果我一次全部选中的话 就错了 可是我不知道该怎么写
请大家 帮我看看 下面这段代码 应该怎么改一下 谢谢了
Dim lmi, lmj, lmk, lmo, lmp, i, j As Integer
Dim lmgl As String
Dim lmgl1 As String
Dim lmgl2 As String
lmgl = ""
lmgl1 = Trim(txtjg.Text)
While lmgl1 <> ""
lmgl2 = Left(lmgl1, 3)
lmgl1 = Mid(lmgl1, 5)
For i = 0 To 54
lmi = Mid(chklm(i).Caption, 1, 1)
lmj = Mid(chklm(i).Caption, 2, 1)
lmk = Mid(lmgl2, 1, 1)
lmo = Mid(lmgl2, 2, 1)
lmp = Mid(lmgl2, 3, 1)
If optlmpc.Value = True Then
If chklm(i).Value = 1 Then
If lmi & lmj <> lmk & lmo And lmi & lmj <> lmk & lmp And lmi & lmj <> lmo & lmp And _
lmj & lmi <> lmk & lmo And lmj & lmi <> lmk & lmp And lmj & lmi <> lmo & lmp Then
lmgl = lmgl2 & " " & lmgl
End If
End If
End If
Next
Wend
txtjg.Text = lmgl