Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 451
  • Last Modified:

MS Access Form Filters Working with Dates and Date Ranges

I made quite a few additions to the attached database so I understand the If statments in the VB code now, but dealing with the dates is a little bit tricky and I am not sure if I know how to handle it in the VBA.

Please take a look at what I am trying to do here.

Scenario1: manager A would like to see all Providers with a [from_date] greater than or equal to 1/1/2003 and a [term date] less than or equal to 8/12/2008, for example.

As I have it right now, I added filter buttons that don't account for the different categories of dates and if I click one filter button, it will work, then I will click the other filter button and it will also work. The problem is that if I put in dates for different fields, the filter buttons won't account for the other fields. You will see when you open my attached database.

Can we get it so that each of the filter buttons filters the entire date range criteria (from_date, term_date, fromfrom_date, tofrom_date, fromterm_date, toterm_date)??
0
IEHP1
Asked:
IEHP1
  • 5
  • 3
1 Solution
 
Rey Obrero (Capricorn1)Commented:
you forgot to attach the db
0
 
IEHP1Author Commented:
Oh, check out my revised Form (super sweet!!!)

Let me know what you think.

I don't have vendorid or vendorname sample data, but you can get the idea (it works with production data).

Can filter on any of the top section fields now using the If statements in VBA (super!!!)
Form-Building-Using-FiltersRev-3.accdb
0
 
Rey Obrero (Capricorn1)Commented:
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
IEHP1Author Commented:
so you didn't change anything except for the form itself? I am looking at it, it works, super!!

What did you change (I am checking what you changed right now)....?

Thx so much (I did get a lot of feedback about "what does this and this date mean" so that design works best because it is clearer).
0
 
Rey Obrero (Capricorn1)Commented:
i added an option group, and filter the dates based n the option selected..

see the codes inside the

 Select Case Me.Date_filter
0
 
IEHP1Author Commented:
Yeah tested it, works great!!

Thanks so much capricorn1!!!
0
 
IEHP1Author Commented:
i saw the Case Statements--I see how that works perfectly...
0
 
IEHP1Author Commented:
Perfect Solution. Capricorn1 mastered this project using VBA syntax that matches the query results exactly!!!! Perfect!!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now