我有這個問題,如果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