M
Melissa
I have a search form with the following fields
Text - Region
Text - Ship To
Text - State
Yes/No - Communication
Yes/No - Performance
Yes/No - Fuel
Values can have any combination of the Yes/No fields.
Here is an example of a search:
Give me all values where State is CO and where Communication is Yes.
Text - Region - Blank
Text - Ship To - Blank
Text - State - CO
Yes/No - Communication - Yes
Yes/No - Performance - Blank
Yes/No - Fuel - Blank
The problem with this filter is all values that equal Yes for both
Communication and Performance do not appear in the results. I only get values
where Yes is under Communications and No on Performance. If I choose Yes for
both Communications and Performance then I don't see values where
Communications and Fuel are Yes and Performance is No. Is there a way to
filter it so rather than looking at Yes or No it can look at Yes, No or Null?
Here's the code I am using. I am not very familiar with writing code so as
much assistance to modifying this would be greatly appreciated!
Private Sub cmdFilter_Click()
If Me.ckboxFilterComm = -1 Then
strWhere = strWhere & "([Communications] = True) AND "
ElseIf Me.ckboxFilterDistComm = 0 Then
strWhere = strWhere & "([Communications] = False) AND "
End If
If Me.ckboxFilterPerf = -1 Then
strWhere = strWhere & "([Performance] = True) AND "
ElseIf Me.ckboxFilterDistComm = 0 Then
strWhere = strWhere & "([Performance] = False) AND "
End If
If Me.ckboxFilterFuel= -1 Then
strWhere = strWhere & "([Fuel] = True) AND "
ElseIf Me.ckboxFilterDistComm = 0 Then
strWhere = strWhere & "([Fuel] = False) AND "
End If
Thanks,
Melissa
Text - Region
Text - Ship To
Text - State
Yes/No - Communication
Yes/No - Performance
Yes/No - Fuel
Values can have any combination of the Yes/No fields.
Here is an example of a search:
Give me all values where State is CO and where Communication is Yes.
Text - Region - Blank
Text - Ship To - Blank
Text - State - CO
Yes/No - Communication - Yes
Yes/No - Performance - Blank
Yes/No - Fuel - Blank
The problem with this filter is all values that equal Yes for both
Communication and Performance do not appear in the results. I only get values
where Yes is under Communications and No on Performance. If I choose Yes for
both Communications and Performance then I don't see values where
Communications and Fuel are Yes and Performance is No. Is there a way to
filter it so rather than looking at Yes or No it can look at Yes, No or Null?
Here's the code I am using. I am not very familiar with writing code so as
much assistance to modifying this would be greatly appreciated!
Private Sub cmdFilter_Click()
If Me.ckboxFilterComm = -1 Then
strWhere = strWhere & "([Communications] = True) AND "
ElseIf Me.ckboxFilterDistComm = 0 Then
strWhere = strWhere & "([Communications] = False) AND "
End If
If Me.ckboxFilterPerf = -1 Then
strWhere = strWhere & "([Performance] = True) AND "
ElseIf Me.ckboxFilterDistComm = 0 Then
strWhere = strWhere & "([Performance] = False) AND "
End If
If Me.ckboxFilterFuel= -1 Then
strWhere = strWhere & "([Fuel] = True) AND "
ElseIf Me.ckboxFilterDistComm = 0 Then
strWhere = strWhere & "([Fuel] = False) AND "
End If
Thanks,
Melissa