Solved

MS Access Form Filters Working with Dates and Date Ranges

Posted on 2013-01-21
8
430 Views
Last Modified: 2013-01-21
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
Comment
Question by:IEHP1
  • 5
  • 3
8 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38802642
you forgot to attach the db
0
 

Author Comment

by:IEHP1
ID: 38803190
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
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 38803198
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:IEHP1
ID: 38803405
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38803458
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
 

Author Comment

by:IEHP1
ID: 38803470
Yeah tested it, works great!!

Thanks so much capricorn1!!!
0
 

Author Comment

by:IEHP1
ID: 38803473
i saw the Case Statements--I see how that works perfectly...
0
 

Author Closing Comment

by:IEHP1
ID: 38803475
Perfect Solution. Capricorn1 mastered this project using VBA syntax that matches the query results exactly!!!! Perfect!!!!
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question