Multiple filters (1 Viewer)

Eddie Mason

Registered User.
Local time
Today, 02:53
Joined
Jan 31, 2003
Messages
142
I hve just completed a form and I want to offer the user a choice to filter the data by Country, Diet and Date Last purchased before and after. I have managed to get it working using (Me.Filter = "Country like ""*" & Me.FilterField & "*"" And Diet Like ""*" & Me.FilterFieldA & "*"" ") for Country and Diet but I cannot get it to work for date after and date before parameters.

Can anyone help me resolve this. Also can I print the results of the filtered form.

kindest regards

Eddie
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:53
Joined
Oct 29, 2018
Messages
21,467
Hi Eddie. I think it might easier to help you if you could provide us a sample db to modify.
 

Micron

AWF VIP
Local time
Yesterday, 21:53
Joined
Oct 20, 2018
Messages
3,478
what you want isn't clear (at least not to me)
- date filter for some other form or
- a different form?
- add date parameters to the filter you show
- 2 different filters for same form at the same time (not possible)?
As long as the plan is legit you probably just didn't delimit your date values...
 

isladogs

MVP / VIP
Local time
Today, 02:53
Joined
Jan 14, 2017
Messages
18,212
Have a look at my two example apps which show how to build SQL strings for Multiple Group and Filter.
The second example includes filtering of date ranges

Both examples also show how to use that SQL in a report to print the selected results

Hope that helps
 

Eddie Mason

Registered User.
Local time
Today, 02:53
Joined
Jan 31, 2003
Messages
142
Hi,

I think I need to clarify what I want to achieve.

I have a table with about 17,500 records, and have created a form for the user to view them. What I want to do is to let the user filter the information by: [Country] eg. (Canada), [diet] eg. (Vegitarian) and [last ordered]: later than eg.(1/1/2017) and before eg. (31/12/2018) and then publish the result as a spread sheet.

I have managed to get the [Country] and [Diet] to work but cannot get the later and before date to work.

From the previous answers I cannot tell whether this is, or is not possible.

kindest regards,

Eddie
 

isladogs

MVP / VIP
Local time
Today, 02:53
Joined
Jan 14, 2017
Messages
18,212
Yes its certainly possible. That's why I pointed you to my example databases where I do very similar multiple filtering including by date range.
I assume you meant display the results as a datasheet though if you really want to export to an Excel spreadsheet you can also do that.
You can of course print the results which you mentioned in post 1. Normally this is done as a report.
 

Eddie Mason

Registered User.
Local time
Today, 02:53
Joined
Jan 31, 2003
Messages
142
Hi,

I am sorry but due to Data Protection laws I cannot provide a sample database.

I have looked at your sample database and I cannot see a date selection only what year that the students are in. In my database I want to select customers that had ordered between defined [after] and [before] dates.

Kindest regards,

Eddie
 

isladogs

MVP / VIP
Local time
Today, 02:53
Joined
Jan 14, 2017
Messages
18,212
If you read my first reply I said that filtering by date range is done in the second example on that Web page - Incident Analysis.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 02:53
Joined
Sep 12, 2006
Messages
15,651
given a continuous form, the user can do a lot of this themselves

just right-click a "country", and select "filter by selection"
just right click a date and enter "filter for" as between date1 and date2

does that work?

I am not sure of the output you will get by printing the form.
 

Users who are viewing this thread

Top Bottom