Morning
This is probably a simple problem but I cant get my form to filter by multiple criteria. And all I can find on the internet is how to define 1 combo box any another. So any help here would be great.
There's 3 fields called Name, Site, Age which are accompanied by 3 combo boxes called NameFilter SiteFilter and AgeFilter on the same form.
I've been using the simplistic
Me.Filter = "(Site) = '" & Me.SiteFilter & "'"
Me.FilterOn = True
For each combo after update to filter the records on the form (ie no new page open it just displays based on the results on the same form) which thus far has been fine.
Its been decided that we now need to be able to filter in a narrower fashion eg find all the records at a specific site that are a specific age.
The easiest way of describing this would be:
Form shows 100 records
The are criteria entered in the on form filter options SiteFilter and AgeFilter
And there are 20 records showing on the same form with everyone from say London who is 55
Now I have had dealings with NULL before and its been a royal pain in the backside so if at all possible because in the example I used above I have left the Name filter option blank is possible to only filter by the options that are selected?
As in the past leaving a field blank has only brought up results where it would be
Name = “”
Site = London
Age = 55
I basically want the name field discounted because its not filled in and not needed for this filter?
I appreciate I have just rambled on so if you need further clarification please just ask
Thank you in advance
This is probably a simple problem but I cant get my form to filter by multiple criteria. And all I can find on the internet is how to define 1 combo box any another. So any help here would be great.
There's 3 fields called Name, Site, Age which are accompanied by 3 combo boxes called NameFilter SiteFilter and AgeFilter on the same form.
I've been using the simplistic
Me.Filter = "(Site) = '" & Me.SiteFilter & "'"
Me.FilterOn = True
For each combo after update to filter the records on the form (ie no new page open it just displays based on the results on the same form) which thus far has been fine.
Its been decided that we now need to be able to filter in a narrower fashion eg find all the records at a specific site that are a specific age.
The easiest way of describing this would be:
Form shows 100 records
The are criteria entered in the on form filter options SiteFilter and AgeFilter
And there are 20 records showing on the same form with everyone from say London who is 55
Now I have had dealings with NULL before and its been a royal pain in the backside so if at all possible because in the example I used above I have left the Name filter option blank is possible to only filter by the options that are selected?
As in the past leaving a field blank has only brought up results where it would be
Name = “”
Site = London
Age = 55
I basically want the name field discounted because its not filled in and not needed for this filter?
I appreciate I have just rambled on so if you need further clarification please just ask
Thank you in advance