473,387 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
2 10671
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Cameron | last post by:
Hi, For the database I am currently working on, my employer would like the ability to use multiple combo boxes in order to filter the database. For instance the structure of the company is based...
0
by: CSDunn | last post by:
Hello, In Access ADP's that connect to SQL Server databases, any time I have a situation where I have a combo box in a main form that looks up a record in a subform, the subform record source has...
9
by: natwong | last post by:
Hi All, I'm a newbie in terms of Access and some of its functionality . I've been stuck on this problem for a couple days, even after searching the Web, etc. Currently I have five combo boxes...
1
by: tomlebold | last post by:
Having problems displaying query results from combo boxes on a sub form, which is on the same form that is used to select criteria. This has always worked form me when displaying query results on...
1
by: lawton | last post by:
Source: this is an access 2003 question My knowledge level: reading books, internet, and trial & error; no formal training I'm trying to get a running sum of what's filtered in a subform which is...
3
by: kaib | last post by:
i've got 2 tables tblCompany and tblHrtasks and on the form: when i choose the company name, the subform gives the details of employee attached to that company; but there is a combo box in the...
1
by: kinglioness | last post by:
Hello All, I am new to this forum so I apologize if this quesiton was asked already. Although i did search but i couldn't find. I have 2 combo boxes one unbound and the other bound they are on...
5
by: samdev | last post by:
I have created two combo boxes in a subform.... For example 1. Combo Box State 2. Combo Box City 3. When a state from the Combo Box State is selected, the City combo box updates to reflect...
4
WyvsEyeView
by: WyvsEyeView | last post by:
I am doing the very standard thing of filtering the contents of one combo box based on another combo box. I've done it many times, but always on a main form. Now I'm trying to do it on a datasheet...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.