Klatuu --- 3rd combo statement wont open query

A

accessdesigner

I copied the 3rd combo statement to be exactly as the second, except to
change field names, but the query wont even open....

dim strWhere As String

If Not IsNull(Me.Combo1) Then
strWhere = "[Field1] = " & Me.Combo1
End If

If Not IsNull(Me.Combo2) Then
If Len(strWhere) > 0 Then
strWhere = strWhere & " And "
End If
strWhere = strwhere & "[Field2] = " & Me.Combo2
End If
........ I left out 3 through 7, but you get the idea, also, I did not
include any delimiters, because I don't know the field data types.

If Not IsNull(Me.Combo8) Then
If Len(strWhere) > 0 Then
strWhere = strWhere & " And "
End If
strWhere = "[Field8] = " & Me.Combo8
End If

Docmd.OpenReport "My ReportName", acPreview, , strWhere
 
Top