Hi. HAve constructed the following If statement but I get an 'Expected End Of Statement' compile error on the last ElseIf line:
If IsNull(Me.cmbSearchList) Then
MsgBox "Please make a valid selection", vbOKOnly
Else
If Me.txtSearchType = "Client" Then
intOrgID = Me.cmbSearchList.Value
strSQL = "OrgID = " & intOrgID & ""
ElseIf Me.txtSearchType = "ContractName" Then
lngContractID = Me.cmbSearchList.Value
strSQL = "ContractID = " & lngContractID & ""
ElseIf Me.txtSearchType = "Location" Then
lngContractID = Me.cmbSearchList.Value
strSQL = "ContractID = " & lngContractID & ""
ElseIf Me.txtSearchType = "PM" Then
intStaffID = Me.cmbSearchList.Value
strSQL = "SDPContractManagerID = " & intStaffID & ""
ElseIf Me.txtSearchType = "Staff" Then
intStaffID = Me.cmbSearchList.Value
strSQL = "StaffID = " & intStaffID & ""
ElseIf Me.txtSearchType = "Status" Then
intStatusID = Me.cmbSearchList.Value
strSQL = "ContractStatusID " & intStatusID & ""
ElseIf Me.txtSearchType = "SubCat" Then
intSubCatID = Me.cmbSearchList.Value
strSQL = "SubCatID " & intSubCatID & ""
ElseIf Me.txtSearchType = "ClientType" Then
intTypeID = Me.cmbSearchList.Value
strSQL = "TypeID = " & intTypeID & ""
ElseIf Me.txtSearchType - "Workstream" Then
intWorkstreamID = Me.cmbSearchList.Value
*** strSQL = "WorkstreamID = " & intWorkstreamID "" *** ERROR HERE
End If
End If
Can anyone explain to me why I get this error?
If IsNull(Me.cmbSearchList) Then
MsgBox "Please make a valid selection", vbOKOnly
Else
If Me.txtSearchType = "Client" Then
intOrgID = Me.cmbSearchList.Value
strSQL = "OrgID = " & intOrgID & ""
ElseIf Me.txtSearchType = "ContractName" Then
lngContractID = Me.cmbSearchList.Value
strSQL = "ContractID = " & lngContractID & ""
ElseIf Me.txtSearchType = "Location" Then
lngContractID = Me.cmbSearchList.Value
strSQL = "ContractID = " & lngContractID & ""
ElseIf Me.txtSearchType = "PM" Then
intStaffID = Me.cmbSearchList.Value
strSQL = "SDPContractManagerID = " & intStaffID & ""
ElseIf Me.txtSearchType = "Staff" Then
intStaffID = Me.cmbSearchList.Value
strSQL = "StaffID = " & intStaffID & ""
ElseIf Me.txtSearchType = "Status" Then
intStatusID = Me.cmbSearchList.Value
strSQL = "ContractStatusID " & intStatusID & ""
ElseIf Me.txtSearchType = "SubCat" Then
intSubCatID = Me.cmbSearchList.Value
strSQL = "SubCatID " & intSubCatID & ""
ElseIf Me.txtSearchType = "ClientType" Then
intTypeID = Me.cmbSearchList.Value
strSQL = "TypeID = " & intTypeID & ""
ElseIf Me.txtSearchType - "Workstream" Then
intWorkstreamID = Me.cmbSearchList.Value
*** strSQL = "WorkstreamID = " & intWorkstreamID "" *** ERROR HERE
End If
End If
Can anyone explain to me why I get this error?