Solved

Filter subform by date

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

831 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