quick filter sometimes working (1 Viewer)

sammers101

Registered User.
Local time
Yesterday, 21:54
Joined
May 11, 2012
Messages
89
I have a datasheet that is filtered when you click any of a few buttons

I use browseTo. A few of the buttons will show the quick filter list. The code for the browseTo is all the same except for the where condition field.

The buttons with these codes does not show a drop down list when I try to filter my datasheet even further (only shows text filters):

Button 1's where condition: [statusID]<10 And ([focDate]-6<=Date() Or IsNull([focDate]))

Button 2's where condition: [statusID]<10 And ([shipDate]-6<=Date() Or IsNull([shipDate])) And ([focDate]-6<=Date() Or IsNull([focDate]))

However, the buttons with this code shows the drop down list:
Button 3's where condition: [statusID]<10
 

Attachments

  • example.png
    example.png
    91.2 KB · Views: 56

CJ_London

Super Moderator
Staff member
Local time
Today, 02:54
Joined
Feb 19, 2013
Messages
16,605
the drop down does not show if the number of possible entries is too great. Not sure what that number is however - it is less than what excel might display, although that has it's limits as well.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:54
Joined
Oct 29, 2018
Messages
21,467
I am wondering what BrowseTo has to do with the issue you're having.
 

sammers101

Registered User.
Local time
Yesterday, 21:54
Joined
May 11, 2012
Messages
89
well browse to with only [statusID]<10 works just fine, when I limit it even more with ([focDate]-6<=Date() Or IsNull([focDate])) it stops showing the list

I think it has something to do with the OR, or maybe the condition is too complex
 

June7

AWF VIP
Local time
Yesterday, 17:54
Joined
Mar 9, 2014
Messages
5,470
I can replicate the issue. Yes, seems to be related to OR operator.

I have never used BrowseTo. I also don't usually allow users QuickSearch facility. I prefer VBA to build filter criteria. http://allenbrowne.com/ser-62.html

The button 2 expression does not make sense with repeat of date criteria.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:54
Joined
Oct 29, 2018
Messages
21,467
I can replicate the issue. Yes, seems to be related to OR operator.
I can't seem to replicate it. Here's my setup:

For the first button, I have the following code:
Code:
Private Sub Command0_Click()
DoCmd.BrowseTo acBrowseToForm, "table1", "browseto.child2"

End Sub
And I get the following result:


For the second button, I have the following code:
Code:
Private Sub Command1_Click()
DoCmd.BrowseTo acBrowseToForm, "table1", "browseto.child2", "[email/com]='a' or [email/com]='b'"

End Sub
And I get the following result:


Did I do it right?
 

Attachments

  • setup.PNG
    setup.PNG
    5.7 KB · Views: 78
  • browse1.PNG
    browse1.PNG
    20.8 KB · Views: 94
  • browse2.PNG
    browse2.PNG
    21.9 KB · Views: 103

Users who are viewing this thread

Top Bottom