Solved: Creating a Filter and Adding dates in VBA Access 2010

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Dobber9

Thread Starter
Joined
Dec 20, 2011
Messages
11
I'm working on a filter to show which Drawing Changes are overdue by selecting check boxes that have certain overdue periods. (e.g. 1-14 days past due, 15-30 day past due, 31-60 days, etc.) I'm not very good at VBA but I'm using some code I have from a search form I used a while ago that has a date filter. I'm confident I can figure out the code for the filter, but I'm not sure how to say what I want to happen in VBA code. What I want the filter to read is this:

If 1-14 days is checked, include entries that (Due Date + 14days) >= Today's date
If 15-30 days is checked, include (Due Date + 30days) >= Today's date AND (Due date +14days) < Today's date
and so on.

I'm using Access 2010 on Windows XP

Thanks for any help!

Dobber9
 
Joined
Jul 29, 2001
Messages
21,334
You could just subtract the due date from today's date and get a number. Are you looking to do this on a form I assume?
 

Dobber9

Thread Starter
Joined
Dec 20, 2011
Messages
11
yeah its a search form with a subform used as the results. When you say, subtract the dates, do you mean that if i just say display entries whose Due date minus today's date < 14, that will work?
 
Joined
Jul 29, 2001
Messages
21,334
Gotcha. You will need to put some logic in there based on which checkbox is ticked and requery the sub form. Is this just to give you some sort of idea when certain things are coming due? You could just create a listbox that sorts them all by the number of days prior to the due date and have them sort in that order.
 

Dobber9

Thread Starter
Joined
Dec 20, 2011
Messages
11
It's meant to list out entries that are overdue. I just don't know how to write the code for the filter
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top