Filtering!!

Crispie38

Registered User.
Local time
Today, 08:42
Joined
Jun 26, 2006
Messages
15
hello

i have a data sheet form which I need some help with!!
I have a lot of data that I need filtering.

The first filter is for day and the second is for time of day.
I.e. i want to be able to click on a date (using the calender from MS datepicker) and have the datasheet return the records for that selected day.

But I would also like another field that can filter it down to a specific time of day. e.g. 27/06, 13:00 returning all the records for this specific time slot.

At the moment there is a filter for date AND time but I would like date AND/OR time.

Also I would like to have it setup so it automatically gets rid of data over 2 months old, is there a way to do that, if not automatically maybe with a macro/command button??

Thanks for you help
 
I'm not sure about MS date picker but it seems to me that when you're fitering by time you are actually filtering by date and time - hence, when you filter by just date you want a wildcard or something for the time part(?).

As for automatically deleting records... you could run a delete query that runs either on a command button or in the OnOpen event of a form (the initially loaded form for example).
Code:
DoCmd.OpenQuery "[I]QueryName[/I]"
You create it just like you would any other query (keeping it a Select query at first) - you need to select all fields for the table you want to delete (myTable.*) and then add a crietria to the date field, like:
Code:
<DateAdd("m", -2, Date())
Once you are sure the query is woking correctly you can change the query type - either in design view or in SQL view by replacing 'SELECT' with 'DELETE'.

HTH,

Bobadopolis
 

Users who are viewing this thread

Back
Top Bottom