我有这个问题,如果ElseIf块,我不知道错误在哪里。如果否则块错误
我得到的消息是“Else without 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
是否错误消息告诉你哪一行的错误是吗? – RichieHindle
在出现的位置添加了一行。 – Dan