Solved

Filter subform by date

Posted on 2003-10-23
1
263 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

707 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