我遇到了这个 If ElseIf 块的问题,我无法弄清楚错误在哪里。
我得到的消息是“没有如果”。
如果有任何帮助或指导,我对使用非常陌生。
错误线:
ElseIf booSM = True And _
booInv = True And _
booHOP = False _
Then strTo = Me.txtServiceManager.Column(1) & ";" & Me.txtInvestigator.Column(1)
完整代码:
Dim txtScan As String
Dim strTo As String
Dim booSM As Boolean
Dim booInv As Boolean
Dim booHOP As Boolean
Me.Refresh
txtScan = Me.txtScanLocation
booSM = booComDocSMSent
booInv = booComDocInvSent
booHOP = booComDocHOPSent
If booSM = True And _
booInv = True And _
booHOP = True _
Then strTo = Me.txtServiceManager.Column(1) & ";" & Me.txtInvestigator.Column(1) & ";" & Me.txtHop.Column(1)
ElseIf booSM = True And _
booInv = True And _
booHOP = False _
Then strTo = Me.txtServiceManager.Column(1) & ";" & Me.txtInvestigator.Column(1)
ElseIf booSM = True And _
booInv = False And _
booHOP = True _
Then strTo = Me.txtServiceManager.Column(1) & ";" & Me.txtHop.Column(1)
ElseIf booSM = False And _
booInv = True And _
booHOP = True _
Then strTo = Me.txtInvestigator.Column(1) & ";" & Me.txtHop.Column(1)
ElseIf booSM = True And _
booInv = False And _
booHOP = False _
Then strTo = Me.txtServiceManager.Column(1)
ElseIf booSM = False And _
booInv = True And _
booHOP = False _
Then strTo = Me.txtInvestigator.Column(1)
ElseIf booSM = False And _
booInv = False And _
booHOP = True _
Then strTo = Me.txtHop.Column(1)
End If