I have a form where the user can select a combo box which will filter the records that are brought back.
However, I receive the error:
"Run time error 3075 - Syntax error (missing operator) in query expression 'tblissues.issueID is >0 and Region = 'CO"."
Here is my code:
strSQL = ""
strSQL = "SELECT tblIssues.IssueID, tblIssues.Region, tblIssues.Category, tblIssues.[BETS Screen], tblIssues.[BETS Field Mapping], tblIssues.[CM Field Mapping], tblIssues.Issue, tblIssues.Description, tblIssues.Status, tblIssues.[Date Opened], tblIssues.[Date Closed], tblIssues.[Point of Contact], tblIssues.Priority, tblIssues.[Application Type], tblIssues.[Issue Area] FROM tblIssues Where tblIssues.IssueID is >0"
If Len([Forms]![frmMenu].[cboSearchIssueID] & "") > 0 Then
Me.RecordSource = strSQL & " And IssueID = "" & ([Forms]![frmMenu].[cboSearchIssueID])"
End If
If Len([Forms]![frmMenu].[cboSearchPriority] & "") > 0 Then
Me.RecordSource = strSQL & " And Priority = ' " & ([Forms]![frmMenu].[cboSearchPriority] & "'")
End If
If Len([Forms]![frmMenu].[cboSearchRegion] & "") > 0 Then
Me.RecordSource = strSQL & " And Region = ' " & ([Forms]![frmMenu].[cboSearchRegion] & "'")
End If
If Len([Forms]![frmMenu].[cboSearchStatus] & "") > 0 Then
Me.RecordSource = strSQL & " And Status = '" & ([Forms]![frmMenu].[cboSearchStatus] & "'")
End If
Been racking my brain over this all day and have had no luck.
Any ideas? Help?
thanks.
However, I receive the error:
"Run time error 3075 - Syntax error (missing operator) in query expression 'tblissues.issueID is >0 and Region = 'CO"."
Here is my code:
strSQL = ""
strSQL = "SELECT tblIssues.IssueID, tblIssues.Region, tblIssues.Category, tblIssues.[BETS Screen], tblIssues.[BETS Field Mapping], tblIssues.[CM Field Mapping], tblIssues.Issue, tblIssues.Description, tblIssues.Status, tblIssues.[Date Opened], tblIssues.[Date Closed], tblIssues.[Point of Contact], tblIssues.Priority, tblIssues.[Application Type], tblIssues.[Issue Area] FROM tblIssues Where tblIssues.IssueID is >0"
If Len([Forms]![frmMenu].[cboSearchIssueID] & "") > 0 Then
Me.RecordSource = strSQL & " And IssueID = "" & ([Forms]![frmMenu].[cboSearchIssueID])"
End If
If Len([Forms]![frmMenu].[cboSearchPriority] & "") > 0 Then
Me.RecordSource = strSQL & " And Priority = ' " & ([Forms]![frmMenu].[cboSearchPriority] & "'")
End If
If Len([Forms]![frmMenu].[cboSearchRegion] & "") > 0 Then
Me.RecordSource = strSQL & " And Region = ' " & ([Forms]![frmMenu].[cboSearchRegion] & "'")
End If
If Len([Forms]![frmMenu].[cboSearchStatus] & "") > 0 Then
Me.RecordSource = strSQL & " And Status = '" & ([Forms]![frmMenu].[cboSearchStatus] & "'")
End If
Been racking my brain over this all day and have had no luck.
Any ideas? Help?
thanks.