By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,827 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,827 IT Pros & Developers. It's quick & easy.

Using Combo Box value on Main form to filter results on subform

P: n/a
Hello,

I am using Access 2003. I have a query which shows a list of club
meetings sorted by date. This query is displayed in continuous forms,
in a subform. I would like to select a month on the main form which
is then used to filter the results for the meeting dates, perhaps by
using monthname(month([meeting_date])).

I have struggled to find the syntax which will allow me to use the
AfterUpdate Event on the combo box to apply and turn on the filter for
the subform.

Does anyone have a process for applying this sort of filter?

Many thanks,

Franc.
Oct 7 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
do, or will, the subform records span more than a year? if so, you'll want
to consider filtering by year as well as by month. otherwise, in a few
years, requesting March will give the user March 2008, March 2009, March
2010...

hth
"franc sutherland" <fr**************@googlemail.comwrote in message
news:a6**********************************@s9g2000p rg.googlegroups.com...
Hello,

I am using Access 2003. I have a query which shows a list of club
meetings sorted by date. This query is displayed in continuous forms,
in a subform. I would like to select a month on the main form which
is then used to filter the results for the meeting dates, perhaps by
using monthname(month([meeting_date])).

I have struggled to find the syntax which will allow me to use the
AfterUpdate Event on the combo box to apply and turn on the filter for
the subform.

Does anyone have a process for applying this sort of filter?

Many thanks,

Franc.

Oct 8 '08 #2

P: n/a
franc sutherland wrote:
Hello,

I am using Access 2003. I have a query which shows a list of club
meetings sorted by date. This query is displayed in continuous forms,
in a subform. I would like to select a month on the main form which
is then used to filter the results for the meeting dates, perhaps by
using monthname(month([meeting_date])).

I have struggled to find the syntax which will allow me to use the
AfterUpdate Event on the combo box to apply and turn on the filter for
the subform.

Does anyone have a process for applying this sort of filter?
Let's say you have MF (main) and SF (subform). You could do, in the
AfterUpdate event of the combo, something like this air code.
Dim strF As String
If not isnull(Me.ComboBoxName) Then
'assumes bound column in combo is the month number
strF = "Month(MeetingDate) = " & Me.ComboBoxName
Endif
Me(SF).Form.Filter = strF
Me(SF).Form.FilterOn = (strF "")

As noted by another, you might want to expand it to filter by year as well.

>
Many thanks,

Franc.
Oct 8 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.