PDA

View Full Version : Solved: Filter by Date Options



RobertBC
08-29-2006, 06:29 AM
good day!
i was trying to create report or printing a report with filter options by date, ill try to use macro but i cant find it usefull. i try use code builder but anyone can give me an idea how to do it pls.

scenario....
let say i have a expences record and i want to print report filter by date:

1. Today
2. This week
3. This month
4. This year
5. By Date options
6. All

thanks for your help :friends:

OBP
08-29-2006, 08:01 AM
The simplest way to achieve this is to use a form to make the choice of filter type and then use that option in the Report's query's criteria rows.
If you can post a zipped copy of the database I will show you how. It does not need to have any real data in it just a couple of dummy records.
You can of course use the VBA docmd print report with filter method, but I prefer the formar method because you can use it for both filtering both reports and forms.

RobertBC
08-29-2006, 01:58 PM
Thanks you!

here i attached a row data or a simple mdb file that will preview or print my expences report.. i didnt add any filter option this time because what i have here is not working.. maybe you can help me with this one and if not too much too ask pls do it for me and for other members reference too or i mean give me an idea how to print report base on filter date options... (macro or code vb editor)

tahnks again you are a big help!

OBP
08-30-2006, 06:19 AM
RobertBC, I have attached your sample database with the following changes.
I have added 1 table/query/form for storing the "chosen Option".
I have added a Form that has 2 Calendars for date selection, although you can type the date in the Fields if you like and an Option Group. The Option Group is used to select the type of filter and also run the a new query that I have added that has the criteria to make the options work.
There is some visual basic in the "Option Group's" after update event procedure that stores your chosen option for the query to look up.

RobertBC
08-30-2006, 06:40 AM
OBP

Thank you very much for your help.. I already looking to it and study how it work and then applying to my database... you are a big help!

at this time the only thing i can share with you and for the other members too is this site: http://www.vebook.org maybye it can help you and others for more references...

tahnks again! :friends: :mbounce2: