L
Londa Sue
Hello,
I've a search form in the database on which users can search on one of three
criteria: process area, practice, or practice satisfaction.
The form works well for process area and practice, but the search using
practice satisfaction is not working. Returns no values.
Here is the code:
Private Function BuildWhereString() As String
Dim strWhere As String
Dim strSQL As String
Dim varItemSel As Variant
On Error Resume Next
strWhere = ""
' ... build "process area" criterion expression
If (Nz(Me.cboProcessArea.Value, "") <> "") Then
strWhere = strWhere & "ProcessArea='" & Me.cboProcessArea.Value & "' And "
End If
' ... build "cmmi practice" criterion expression
If (Nz(Me.cboCMMIPractice.Value, "") <> "") Then
strWhere = strWhere & "CMMIPractice='" & Me.cboCMMIPractice.Value & "' And "
End If
' ... build "practice satisfied" criterion expression
If (Nz(Me.cboPracticeSatisfied.Value, "") <> "") Then
strWhere = strWhere & "PracticeSatisfied='" &
Me.cboPracticeSatisfied.Value & "' And "
End If
' Strip off the trailing " And " text string
If Len(strWhere) > 0 Then strWhere = Left(strWhere, Len(strWhere) - _
Len(" And "))
BuildWhereString = strWhere
Exit Function
End Function
Any help on this is appreciated,
I've a search form in the database on which users can search on one of three
criteria: process area, practice, or practice satisfaction.
The form works well for process area and practice, but the search using
practice satisfaction is not working. Returns no values.
Here is the code:
Private Function BuildWhereString() As String
Dim strWhere As String
Dim strSQL As String
Dim varItemSel As Variant
On Error Resume Next
strWhere = ""
' ... build "process area" criterion expression
If (Nz(Me.cboProcessArea.Value, "") <> "") Then
strWhere = strWhere & "ProcessArea='" & Me.cboProcessArea.Value & "' And "
End If
' ... build "cmmi practice" criterion expression
If (Nz(Me.cboCMMIPractice.Value, "") <> "") Then
strWhere = strWhere & "CMMIPractice='" & Me.cboCMMIPractice.Value & "' And "
End If
' ... build "practice satisfied" criterion expression
If (Nz(Me.cboPracticeSatisfied.Value, "") <> "") Then
strWhere = strWhere & "PracticeSatisfied='" &
Me.cboPracticeSatisfied.Value & "' And "
End If
' Strip off the trailing " And " text string
If Len(strWhere) > 0 Then strWhere = Left(strWhere, Len(strWhere) - _
Len(" And "))
BuildWhereString = strWhere
Exit Function
End Function
Any help on this is appreciated,