473,463 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Filter Form through sub-form values

I would like to add filter functionality to my database whether
through the Main form or the subform. This question may be
rudimentary, yet I have not less experience with filtering data
outside from queries. Let me just add that Allen Browne excellent
article about this subject may not apply to this scenario on an
elementary level. (Here's the link to the article; Filter a Form on a
Field in a Subform - http://users.bigpond.net.au/abrowne1/ser-28.html)

Here's the scenario on my company form with an address subform
(one-to-many). A company could have multiple addresses and an address
could have many companies. The address subform list addresses in
single form view. The main company form has the tblComp as the record
source; address subform has a query based record source with
trelCompAddr and tblAddr. The address table also holds address data
for my project and contact tables. The linking table, trelCompAddress
contains phone number and email data.

I would like to filter the form (not by query) by area code.
Normally, I would create a query with tblComp, trelCompAddr, and
tblAddr; and set the phone field criteria to Like 212*. I would like
to filter company form with this area code and scroll through the
record subset using the Main Form. In addition, the main company form
and subform should remain editable at any time.

This feat seems more ambition if using the Access Advance Filter
dialog. Does it mean using the "On Filter" event to change the main
forms record source? Or Does one the "Apply Filter" event? "On
Filter" vs. "Apply Filter"? How would you change back the record
source when removing the filter? Both the main form and subform
should remain editable with the applied filter. Let me know if
someone could elaborate more on filtering forms through sub-form
values. Code Examples would help as well. How does this approach deal
with the other Access default filter option like Filter by Form?

Nov 12 '05 #1
1 7826
When you set a filter on a form, you are not changing the RecordSource of
that form. You are just using a filter on the form. This filter string is
held in the form's Filter property. You can turn a filter on or off by
setting the .FilterOn property to True or False respectively.

--
Ken Snell
<MS ACCESS MVP>

"Robert Neville" <robert_neville@y@h0o.com> wrote in message
news:4d********************************@4ax.com...
I would like to add filter functionality to my database whether
through the Main form or the subform. This question may be
rudimentary, yet I have not less experience with filtering data
outside from queries. Let me just add that Allen Browne excellent
article about this subject may not apply to this scenario on an
elementary level. (Here's the link to the article; Filter a Form on a
Field in a Subform - http://users.bigpond.net.au/abrowne1/ser-28.html)

Here's the scenario on my company form with an address subform
(one-to-many). A company could have multiple addresses and an address
could have many companies. The address subform list addresses in
single form view. The main company form has the tblComp as the record
source; address subform has a query based record source with
trelCompAddr and tblAddr. The address table also holds address data
for my project and contact tables. The linking table, trelCompAddress
contains phone number and email data.

I would like to filter the form (not by query) by area code.
Normally, I would create a query with tblComp, trelCompAddr, and
tblAddr; and set the phone field criteria to Like 212*. I would like
to filter company form with this area code and scroll through the
record subset using the Main Form. In addition, the main company form
and subform should remain editable at any time.

This feat seems more ambition if using the Access Advance Filter
dialog. Does it mean using the "On Filter" event to change the main
forms record source? Or Does one the "Apply Filter" event? "On
Filter" vs. "Apply Filter"? How would you change back the record
source when removing the filter? Both the main form and subform
should remain editable with the applied filter. Let me know if
someone could elaborate more on filtering forms through sub-form
values. Code Examples would help as well. How does this approach deal
with the other Access default filter option like Filter by Form?

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Xah Lee | last post by:
© # -*- coding: utf-8 -*- © # Python © © # the "filter" function can be used to © # reduce a list such that unwanted © # elements are removed. © # example: © © def even(n): return n % 2 == 0...
1
by: Lou | last post by:
I'm using the Response Filter Class in MS KB article 811162 (http://support.microsoft.com/default.aspx?scid=kb;EN-US;811162) to generate a static htm page from an asp.net template page being...
4
by: crispywafers | last post by:
Hi, Is it possible to filter ontop of the current filter being applied to records? This seems like it should be easy? I have two drop down boxes-- one to filter on a student's last name, one...
3
by: Brad | last post by:
I have a response filter which injects "standard" html into my pages. The filter works fine when the initial stream is small enough not to buffer...or....if I have a large unbuffered stream (i.e. I...
0
by: RyanG | last post by:
when the value that determines the filter is databound?? I am trying to make a DropDownList for a set of data that I use a lot throughout my project. So I extended the DropDownList to retrieve...
1
by: Stanley | last post by:
Hello all, I have a custom collection that I am using to fill a DropDown list that I need to filter out items based on another dropdown list. My problem is the actual filter in the collection. I...
3
by: MLH | last post by:
Private Sub Command0_Click() Dim MyReport As Report MyReport.Name = "rptStateOfAffairs" MyReport.Filter = "ClusterName = 'Auto Company, Inc'" Me.FilterOn = True DoCmd.OpenReport MyReport.Name...
4
by: Sheree | last post by:
I have some Access 2003 VBA code that looks like this: Private Sub SubName() Me.FilterOn = True Me.Filter = "" ' Me.FilterOn = False ' Me.Requery x = msgbox("Filter Cleared. Number of...
1
by: Joelle | last post by:
Hi everyone, i am really stack!i need help I have this report:"RequirementObjects_Report",i have also a multiselect listbox whicg contains a list of products.what i want to do is to filter the...
4
by: MLH | last post by:
If I have a main form - Form3 - with a subform control named SF4 and they are NOT linked on any common field (no child or master field links) - can I write code on Form3 to filter the records...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.