Solved

Filter subform by date

Posted on 2003-10-23
1
248 Views
Last Modified: 2010-05-18
Hello dear expert friends,

I've got to make a form with a subform in it, that is sorted by date. The form (frmPepijn) has a combobox (cmbWeek) with all dates in of all the mondays of the year, so you can view the data of the whole week.

the subform has a field event_planning_date, that is used to sort and to filter on.

Now i would like to have the subform filtered when i update the combobox when the date is the same or 1 more, 2, 3, 4, 5 or 6 more.

Thanks in advance,
$h0rTy
0
Comment
Question by:Sh0rTy
1 Comment
 
LVL 39

Accepted Solution

by:
stevbe earned 125 total points
ID: 9605750
change subformname to the name of the subform control (not the subform itself)
Private Sub cmbWeek_AfterUpdate()
With Me.subformname.Form
   .Filter = "event_planning_date BETWEEN #" & Me.cmbWeek.Value & "# AND #" & Me.cmbWeek.Value + 6 & "#"
   .FilterOn = True
End With
End Sub

Steve
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

828 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