主题:一断程序不能执行,急用!
.........
TjXs += "其他信息:" + vbCrLf
Dim B1 As Boolean = False
If Trim(Me.ComboBox9.Text) <> "" And Trim(Me.ComboBox10.Text) <> "" Then
i = Me.ComboBox9.Items.Count - 1
For I1 = 0 To i Step 1
If Trim(Me.ComboBox9.Text) = Me.ComboBox9.Items.Item(I1) And Trim(Me.ComboBox10.Text) = Me.ComboBox10.Items.Item(I1) Then
B1 = True
Me.ComboBox9.Focus()
Exit Sub
End If
Next
End If
If B1 Then
For I1 = 0 To i Step 1
T = Trim(Me.ComboBox9.Items.Item(I1))
TjXs += " 名称:" + T + vbCrLf
T = Trim(Me.ComboBox10.Items.Item(I1))
TjXs += " 内容:" + T + vbCrLf
TjXs += vbCrLf
Next
Else
TjXs += " 名称:" + Trim(Me.ComboBox9.Text) + vbCrLf
TjXs += " 内容:" + Trim(Me.ComboBox10.Text) + vbCrLf
TjXs += vbCrLf
For I1 = 0 To i Step 1
T = Trim(Me.ComboBox9.Items.Item(I1))
TjXs += " 名称:" + T + vbCrLf
T = Trim(Me.ComboBox10.Items.Item(I1))
TjXs += " 内容:" + T + vbCrLf
TjXs += vbCrLf
Next
End If
TjXs += "其他信息:" + Me.TextBox2.Text + vbCrLf
.........
红色部分不能执行,即使用使B1=true 变量TjXs也没有变化,到这一步蓝色部分也不执行;
但是如果是B1=False 一切都没有问题。