I have a form with listbox, based on query.
I have two option groups on my form, and want to combine filter result, to show filtered result same time, if I toggle between options.
if one of the option is selected in Frame155 (other than default option) then
If i move between options in Frame173, then option in this filter work, but the option which is already selected in Frame155 stops working and but filters with default option "All"
Briefly: Filter options work perefectly fine independent of each other, but I want to combine those.
Here is my code for each Frame and has no difference on After update or click event.
I have two option groups on my form, and want to combine filter result, to show filtered result same time, if I toggle between options.
- Option group with Frame155 filters status of Articles
- Option group with Frame173 filters date criteria
- Frame155 (All, Approved, Pending)
- Frame173 (All, 180days, 30days)
if one of the option is selected in Frame155 (other than default option) then
If i move between options in Frame173, then option in this filter work, but the option which is already selected in Frame155 stops working and but filters with default option "All"
Briefly: Filter options work perefectly fine independent of each other, but I want to combine those.
Here is my code for each Frame and has no difference on After update or click event.
Code:
Private Sub Frame155_AfterUpdate()
If Frame155 = 1 Then
Me.SearchResults.RowSource = "SELECT * FROM Query1 ORDER BY Query1.ID DESC"
Else
If Frame155 = 2 Then
Me.SearchResults.RowSource = "SELECT * FROM Query1 " & _
"WHERE ((Query1.[Status])= 'Approved') ORDER BY Query1.ID DESC"
Else
If Frame155 = 3 Then
Me.SearchResults.RowSource = "SELECT * FROM Query1 " & _
"WHERE ((Query1.[Status])= 'Pending') ORDER BY Query1.ID DESC"
Code:
Private Sub Frame173_AfterUpdate()
If Frame173 = 1 Then
Me.SearchResults.RowSource = "SELECT * FROM Query1 ORDER BY Query1.ID DESC"
Else
If Frame173 = 2 Then
Me.SearchResults.RowSource = "SELECT * FROM Query1 " & _
"WHERE (((Query1.[Dateorder])>=Date()-180))ORDER BY Query1.ID DESC"
Else
If Frame173 = 3 Then
Me.SearchResults.RowSource = "SELECT * FROM Query1 " & _
"WHERE (((Query1.[DateOrder])>=Date()-30))ORDER BY Query1.ID DESC"