473,322 Members | 1,510 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,322 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 10670
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.