G
Gina Whipp
Hey All
I have 3 combo oboxes
1 = BrokerID which is registered once the Broker Logs On
2 = cboSortBy which is Listing Type (E, O, P, etc...)
3 = cboStateID is the third.
What I want to happen is if cboSortBy is empty is for it to look just at 1
and itself(3) to filter by. What does happen is I get ALL the states
ignoring even the BrokerID. Can someone help me as to what I am doing
wrong?
Dim fltrcriteria As String
fltrcriteria = ""
Me.cboListerName = ""
Me.cboPhone = ""
Me.cboFranchiseID = ""
If Me.cboState = "ALL" Then
fltrcriteria = "[btBrokerID] = Forms![frmLogOn]![cboLoginID]"
Me.cboSortBy = ""
If Me.cboSortBy = "" Or IsNull([cboSortBy]) Then
fltrcriteria = "[llStateID] = '" & Me.cboState & "'" & " And
[btBrokerID] = Forms![frmLogOn]![cboLoginID]"
Else
fltrcriteria = "[llStateID] = '" & Me.cboState & "'" & " And
[btBrokerID] = Forms![frmLogOn]![cboLoginID]" & " And [llListingTypeID] = '"
& cboSortBy & "'"
End If
End If
Me.Filter = fltrcriteria
Me.FilterOn = True
Me.Form.AllowAdditions = False
Thanks,
Gina Whipp
"I feel I have been denied critical, need to know, information!" - Tremors
II
I have 3 combo oboxes
1 = BrokerID which is registered once the Broker Logs On
2 = cboSortBy which is Listing Type (E, O, P, etc...)
3 = cboStateID is the third.
What I want to happen is if cboSortBy is empty is for it to look just at 1
and itself(3) to filter by. What does happen is I get ALL the states
ignoring even the BrokerID. Can someone help me as to what I am doing
wrong?
Dim fltrcriteria As String
fltrcriteria = ""
Me.cboListerName = ""
Me.cboPhone = ""
Me.cboFranchiseID = ""
If Me.cboState = "ALL" Then
fltrcriteria = "[btBrokerID] = Forms![frmLogOn]![cboLoginID]"
Me.cboSortBy = ""
If Me.cboSortBy = "" Or IsNull([cboSortBy]) Then
fltrcriteria = "[llStateID] = '" & Me.cboState & "'" & " And
[btBrokerID] = Forms![frmLogOn]![cboLoginID]"
Else
fltrcriteria = "[llStateID] = '" & Me.cboState & "'" & " And
[btBrokerID] = Forms![frmLogOn]![cboLoginID]" & " And [llListingTypeID] = '"
& cboSortBy & "'"
End If
End If
Me.Filter = fltrcriteria
Me.FilterOn = True
Me.Form.AllowAdditions = False
Thanks,
Gina Whipp
"I feel I have been denied critical, need to know, information!" - Tremors
II