Ok, I was looking at it a little further. I changed this throughout the month strings:
[CODE=vb] 'number field example
If Me.CkJan = -1 And Not IsNull(Me.Month (1)) Then
strWhere = strWhere & "([COMPILE_HIST.Mo nth] = 1) AND "
End If[/CODE]
TO
[CODE=vb] 'number field example
If Me.CkJan = -1 And Not IsNull(Me.CkJan ) Then
strWhere = strWhere & "([COMPILE_HIST.Mo nth] = 1) AND "
End If[/CODE]
and applied this concept to the Market checkboxes changing:
[CODE=vb] If Me.SMCkBox = -1 Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = True) OR "
ElseIf Me.SMCkBox = 0 Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = False) OR "
End If
If Me.MMCkBox = -1 Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = True) OR "
ElseIf Me.MMCkBox = 0 Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = False) AND "
End If[/CODE]
TO
[CODE=vb] If Me.SMCkBox = -1 And Not IsNull(Me.SMCkB ox) Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = 1) AND "
End If
If Me.MMCkBox = -1 And Not IsNull(Me.MMCkB ox) Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = 2) AND "
End If[/CODE]
Now when I run I'm back to the 3075 error and the following string appears in the immediate window on debug:
[CODE=sql]([COMPILE_HIST.NA C] Like *A Inger*) AND ([COMPILE_HIST.AE] Like *A Gentry*) AND ([COMPILE_HIST.Sa lesPerson] Like *A Morris*) AND ([COMPILE_HIST.Sa lesManager] Like *A Frazier*) AND (([COMPILE_HIST.Ye ar] = 2005) AND ([COMPILE_HIST.Ye ar] = 2006) AND ([COMPILE_HIST.Ye ar] = 2007)) AND ([COMPILE_HIST.Mo nth] = 1) AND ([COMPILE_HIST.Mo nth] = 2) AND ([COMPILE_HIST.Mo nth] = 3) AND ([COMPILE_HIST.Mo nth] = 4) AND ([COMPILE_HIST.Mo nth] = 5) AND ([COMPILE_HIST.Mo nth] = 6) AND ([COMPILE_HIST.Mo nth] = 7) AND ([COMPILE_HIST.Mo nth] = 8) AND ([COMPILE_HIST.Mo nth] = 9) AND ([COMPILE_HIST.Mo nth] = 10) AND ([COMPILE_HIST.Mo nth] = 11) AND ([COMPILE_HIST.Mo nth] = 12) AND ([COMPILE_HIST.Ma rketID] = 1) AND ([COMPILE_HIST.Ma rketID] = 2)[/CODE]
Let me know what you think (if I'm thinking in the right direction).
martin
[CODE=vb] 'number field example
If Me.CkJan = -1 And Not IsNull(Me.Month (1)) Then
strWhere = strWhere & "([COMPILE_HIST.Mo nth] = 1) AND "
End If[/CODE]
TO
[CODE=vb] 'number field example
If Me.CkJan = -1 And Not IsNull(Me.CkJan ) Then
strWhere = strWhere & "([COMPILE_HIST.Mo nth] = 1) AND "
End If[/CODE]
and applied this concept to the Market checkboxes changing:
[CODE=vb] If Me.SMCkBox = -1 Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = True) OR "
ElseIf Me.SMCkBox = 0 Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = False) OR "
End If
If Me.MMCkBox = -1 Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = True) OR "
ElseIf Me.MMCkBox = 0 Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = False) AND "
End If[/CODE]
TO
[CODE=vb] If Me.SMCkBox = -1 And Not IsNull(Me.SMCkB ox) Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = 1) AND "
End If
If Me.MMCkBox = -1 And Not IsNull(Me.MMCkB ox) Then
strWhere = strWhere & "([COMPILE_HIST.Ma rketID] = 2) AND "
End If[/CODE]
Now when I run I'm back to the 3075 error and the following string appears in the immediate window on debug:
[CODE=sql]([COMPILE_HIST.NA C] Like *A Inger*) AND ([COMPILE_HIST.AE] Like *A Gentry*) AND ([COMPILE_HIST.Sa lesPerson] Like *A Morris*) AND ([COMPILE_HIST.Sa lesManager] Like *A Frazier*) AND (([COMPILE_HIST.Ye ar] = 2005) AND ([COMPILE_HIST.Ye ar] = 2006) AND ([COMPILE_HIST.Ye ar] = 2007)) AND ([COMPILE_HIST.Mo nth] = 1) AND ([COMPILE_HIST.Mo nth] = 2) AND ([COMPILE_HIST.Mo nth] = 3) AND ([COMPILE_HIST.Mo nth] = 4) AND ([COMPILE_HIST.Mo nth] = 5) AND ([COMPILE_HIST.Mo nth] = 6) AND ([COMPILE_HIST.Mo nth] = 7) AND ([COMPILE_HIST.Mo nth] = 8) AND ([COMPILE_HIST.Mo nth] = 9) AND ([COMPILE_HIST.Mo nth] = 10) AND ([COMPILE_HIST.Mo nth] = 11) AND ([COMPILE_HIST.Mo nth] = 12) AND ([COMPILE_HIST.Ma rketID] = 1) AND ([COMPILE_HIST.Ma rketID] = 2)[/CODE]
Let me know what you think (if I'm thinking in the right direction).
martin
Comment