Solved

Filter subform by date

Posted on 2003-10-23
1
214 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now