【发布时间】:2015-01-09 00:28:50
【问题描述】:
有没有一种速记方法来编写这么一大段代码?
我目前的工作 - 但事实证明,要维护它是一种痛苦。
If cboOption1 = "bp" And cboOption5 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption1 = "bp" And cboOption6 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs"))
ElseIf cboOption1 = "bp" And cboOption7 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption1 = "bp" And cboOption8 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption2 = "bp" And cboOption5 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption2 = "bp" And cboOption6 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption2 = "bp" And cboOption7 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption2 = "bp" And cboOption8 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption3 = "bp" And cboOption5 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption3 = "bp" And cboOption6 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption3 = "bp" And cboOption7 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption3 = "bp" And cboOption8 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption4 = "bp" And cboOption5 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption4 = "bp" And cboOption6 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption4 = "bp" And cboOption7 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
ElseIf cboOption4 = "bp" And cboOption8 = "cs" Then
Valid = False
MsgBox ("You can not select bp and cs")
【问题讨论】:
标签: ms-access combobox vba ms-access-2010